Unified · Split
| @@ -190,7 +190,10 @@ vm_string_t::vm_string_t(std::size_t encoded_str_len, const uint8_t *encoded_str · 189 unmodified lines | ||
| 190 | 190 | , _length_max{ sizeof(_mem.local) } |
| 191 | 191 | , _mem{} |
| 192 | 192 | { |
| 193 | − assert((encoded_str_len > 0 && encoded_str != nullptr) || (encoded_str_len == 0 && encoded_str == nullptr)); | |
| 193 | + assert((encoded_str_len > 0 && encoded_str != nullptr) || encoded_str_len == 0); | |
| 194 | + if (encoded_str_len == 0) | |
| 195 | + encoded_str = nullptr; | |
| 196 | + | |
| 194 | 197 | const auto utf8_length = utf8::count_codepoints(encoded_str, encoded_str_len); |
| 195 | 198 | |
| 196 | 199 | // Check if the supplied string is completely valid UTF-8 - only valid UTF-8 strings can be DisVM strings. |
| @@ -41,8 +41,8 @@ namespace disvm · 40 unmodified lines | ||
| 41 | 41 | enum class cfs_flags_t |
| 42 | 42 | { |
| 43 | 43 | none = 0, |
| 44 | − atomic = 1, | |
| 45 | − ensure_create = 2, | |
| 44 | + atomic = 1 << 0, | |
| 45 | + ensure_create = 1 << 1, | |
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | 48 | DEFINE_ENUM_FLAG_OPERATORS(cfs_flags_t); |
| @@ -91,7 +91,8 @@ vm_config_t::vm_config_t(vm_config_t &&other) · 90 unmodified lines | ||
| 91 | 91 | { } |
| 92 | 92 | |
| 93 | 93 | vm_t::vm_t() |
| 94 | − : _last_syscall_error_message_lock{ ATOMIC_FLAG_INIT } | |
| 94 | + : _last_syscall_error_message{} | |
| 95 | + , _last_syscall_error_message_lock{ ATOMIC_FLAG_INIT } | |
| 95 | 96 | { |
| 96 | 97 | // Initialize built-in modules. |
| 97 | 98 | builtin::initialize_builtin_modules(); |
| @@ -102,6 +103,7 @@ vm_t::vm_t() · 4 unmodified lines | ||
| 102 | 103 | } |
| 103 | 104 | |
| 104 | 105 | vm_t::vm_t(vm_config_t config) |
| 106 | + : _last_syscall_error_message{} | |
| 105 | 107 | { |
| 106 | 108 | // Initialize built-in modules. |
| 107 | 109 | builtin::initialize_builtin_modules(); |