Showing the changes to src/asm/sbl_reader.cpp (1 of 10 files). Show all
Unified · Split
| @@ -366,10 +366,7 @@ namespace · 365 unmodified lines | |||
| 366 | 366 | ||
| 367 | if (parts.size() == 3) | 367 | if (parts.size() == 3) |
| 368 | { | 368 | { |
| 369 | item.size_in_bytes = std::strtol(parts[2].c_str(), nullptr, 10); | 369 | item.size_in_bytes = std::stoi(parts[2]); |
| 370 | if (item.size_in_bytes == 0 && errno != 0) | ||
| 371 | throw std::runtime_error{ "Invalid adt size" }; | ||
| 372 | |||
| 373 | item.id_table = read_id_table(r, tt, fc); | 370 | item.id_table = read_id_table(r, tt, fc); |
| 374 | } | 371 | } |
| 375 | 372 | ||
| @@ -429,9 +426,6 @@ namespace · 53 unmodified lines | |||
| 429 | { | 426 | { |
| 430 | auto type_index = r.get_as_string_until('\n'); | 427 | auto type_index = r.get_as_string_until('\n'); |
| 431 | const auto idx = std::stoi(type_index); | 428 | const auto idx = std::stoi(type_index); |
| 432 | if (idx == 0) | ||
| 433 | throw std::runtime_error{ "Invalid type index" }; | ||
| 434 | |||
| 435 | t.value_index_1 = type_table_t::types_mask | idx; | 429 | t.value_index_1 = type_table_t::types_mask | idx; |
| 436 | break; | 430 | break; |
| 437 | } | 431 | } |
| @@ -681,6 +675,11 @@ namespace · 243 unmodified lines | |||
| 681 | return _file->header.module_name; | 675 | return _file->header.module_name; |
| 682 | } | 676 | } |
| 683 | 677 | ||
| 678 | size_t get_instruction_count() const | ||
| 679 | { | ||
| 680 | return _file->pc_table.size(); | ||
| 681 | } | ||
| 682 | |||
| 684 | std::unique_ptr<symbol_debug_t> get_debug() override | 683 | std::unique_ptr<symbol_debug_t> get_debug() override |
| 685 | { | 684 | { |
| 686 | return std::make_unique<sbl_symbol_debug>(_file); | 685 | return std::make_unique<sbl_symbol_debug>(_file); |