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 | 367 | if (parts.size() == 3) |
| 368 | 368 | { |
| 369 | − item.size_in_bytes = std::strtol(parts[2].c_str(), nullptr, 10); | |
| 370 | − if (item.size_in_bytes == 0 && errno != 0) | |
| 371 | − throw std::runtime_error{ "Invalid adt size" }; | |
| 372 | − | |
| 369 | + item.size_in_bytes = std::stoi(parts[2]); | |
| 373 | 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 | 427 | auto type_index = r.get_as_string_until('\n'); |
| 431 | 428 | const auto idx = std::stoi(type_index); |
| 432 | − if (idx == 0) | |
| 433 | − throw std::runtime_error{ "Invalid type index" }; | |
| 434 | − | |
| 435 | 429 | t.value_index_1 = type_table_t::types_mask | idx; |
| 436 | 430 | break; |
| 437 | 431 | } |
| @@ -681,6 +675,11 @@ namespace · 243 unmodified lines | ||
| 681 | 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 | 683 | std::unique_ptr<symbol_debug_t> get_debug() override |
| 685 | 684 | { |
| 686 | 685 | return std::make_unique<sbl_symbol_debug>(_file); |