Code analysis violations Bug in scheduler - race during with worker thread shutdown.
Showing the changes to src/vm/module_reader.cpp (1 of 18 files). Show all
Unified · Split
| @@ -392,8 +392,8 @@ namespace · 391 unmodified lines | ||
| 392 | 392 | auto base = reinterpret_cast<byte_t *>(modobj.original_mp->get_allocation()); |
| 393 | 393 | for (;;) |
| 394 | 394 | { |
| 395 | − auto bytesRead = reader.get_next_bytes(sizeof(code), &code); | |
| 396 | − if (bytesRead != sizeof(code)) throw module_reader_exception{ "Failed to read data item code" }; | |
| 395 | + auto bytes_read = reader.get_next_bytes(sizeof(code), &code); | |
| 396 | + if (bytes_read != sizeof(code)) throw module_reader_exception{ "Failed to read data item code" }; | |
| 397 | 397 | if (code == 0) |
| 398 | 398 | break; |
| 399 | 399 | |
| @@ -444,8 +444,8 @@ namespace · 44 unmodified lines | ||
| 444 | 444 | case datum_type_t::utf_string: |
| 445 | 445 | { |
| 446 | 446 | auto str_buffer = std::vector<uint8_t>(count); |
| 447 | − auto bytesRead = reader.get_next_bytes(count, str_buffer.data()); | |
| 448 | − if (bytesRead != count) | |
| 447 | + auto str_bytes = reader.get_next_bytes(count, str_buffer.data()); | |
| 448 | + if (str_bytes != count) | |
| 449 | 449 | throw module_reader_exception{ "Failed to read string data" }; |
| 450 | 450 | |
| 451 | 451 | auto new_string = new vm_string_t(str_buffer.size(), str_buffer.data()); |