1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-04 17:56:29 +00:00

Missed from previous commit; removed assumption that get_next_data always succeeds.

This commit is contained in:
Thomas Harte 2016-09-08 07:39:43 -04:00
parent 54557d7f13
commit 2b053436e5

View File

@ -378,16 +378,18 @@ std::list<File> StaticAnalyser::Commodore::GetFiles(const std::shared_ptr<Storag
case Header::NonRelocatableProgram: case Header::NonRelocatableProgram:
{ {
std::unique_ptr<Data> data = parser.get_next_data(); std::unique_ptr<Data> data = parser.get_next_data();
if(data)
{
File new_file;
new_file.name = header->name;
new_file.raw_name = header->raw_name;
new_file.starting_address = header->starting_address;
new_file.ending_address = header->ending_address;
new_file.data.swap(data->data);
new_file.type = (header->type == Header::RelocatableProgram) ? File::RelocatableProgram : File::NonRelocatableProgram;
File new_file; file_list.push_back(new_file);
new_file.name = header->name; }
new_file.raw_name = header->raw_name;
new_file.starting_address = header->starting_address;
new_file.ending_address = header->ending_address;
new_file.data.swap(data->data);
new_file.type = (header->type == Header::RelocatableProgram) ? File::RelocatableProgram : File::NonRelocatableProgram;
file_list.push_back(new_file);
header = parser.get_next_header(); header = parser.get_next_header();
} }