mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
update readme and fix always playing str (#1139)
* update readme deps * replace assert * bump timeout * fix memory corruption in kernel * use unknown if level name is invalid
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "third-party/json.hpp"
|
||||
#include "common/log/log.h"
|
||||
#include "common/goos/PrettyPrinter.h"
|
||||
#include "common/util/assert.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
namespace decompiler {
|
||||
/*!
|
||||
@@ -22,7 +22,7 @@ namespace decompiler {
|
||||
* This can only be done once, and must be done before adding any words.
|
||||
*/
|
||||
void LinkedObjectFile::set_segment_count(int n_segs) {
|
||||
assert(segments == 0);
|
||||
ASSERT(segments == 0);
|
||||
segments = n_segs;
|
||||
words_by_seg.resize(n_segs);
|
||||
label_per_seg_by_offset.resize(n_segs);
|
||||
@@ -56,8 +56,8 @@ int LinkedObjectFile::get_label_id_for(int seg, int offset) {
|
||||
} else {
|
||||
// return an existing label
|
||||
auto& label = labels.at(kv->second);
|
||||
assert(label.offset == offset);
|
||||
assert(label.target_segment == seg);
|
||||
ASSERT(label.offset == offset);
|
||||
ASSERT(label.target_segment == seg);
|
||||
return kv->second;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ Function& LinkedObjectFile::get_function_at_label(int label_id) {
|
||||
}
|
||||
}
|
||||
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
return functions_by_seg.front().front(); // to avoid error
|
||||
}
|
||||
|
||||
@@ -147,16 +147,16 @@ bool LinkedObjectFile::pointer_link_word(int source_segment,
|
||||
int source_offset,
|
||||
int dest_segment,
|
||||
int dest_offset) {
|
||||
assert((source_offset % 4) == 0);
|
||||
ASSERT((source_offset % 4) == 0);
|
||||
|
||||
auto& word = words_by_seg.at(source_segment).at(source_offset / 4);
|
||||
assert(word.kind() == LinkedWord::PLAIN_DATA);
|
||||
ASSERT(word.kind() == LinkedWord::PLAIN_DATA);
|
||||
|
||||
if (dest_offset / 4 > (int)words_by_seg.at(dest_segment).size()) {
|
||||
// printf("HACK bad link ignored!\n");
|
||||
return false;
|
||||
}
|
||||
assert(dest_offset / 4 <= (int)words_by_seg.at(dest_segment).size());
|
||||
ASSERT(dest_offset / 4 <= (int)words_by_seg.at(dest_segment).size());
|
||||
|
||||
word.set_to_pointer(LinkedWord::PTR, get_label_id_for(dest_segment, dest_offset));
|
||||
return true;
|
||||
@@ -169,9 +169,9 @@ void LinkedObjectFile::symbol_link_word(int source_segment,
|
||||
int source_offset,
|
||||
const char* name,
|
||||
LinkedWord::Kind kind) {
|
||||
assert((source_offset % 4) == 0);
|
||||
ASSERT((source_offset % 4) == 0);
|
||||
auto& word = words_by_seg.at(source_segment).at(source_offset / 4);
|
||||
// assert(word.kind == LinkedWord::PLAIN_DATA);
|
||||
// ASSERT(word.kind == LinkedWord::PLAIN_DATA);
|
||||
if (word.kind() != LinkedWord::PLAIN_DATA) {
|
||||
printf("bad symbol link word\n");
|
||||
}
|
||||
@@ -183,9 +183,9 @@ void LinkedObjectFile::symbol_link_word(int source_segment,
|
||||
* the symbol table register.
|
||||
*/
|
||||
void LinkedObjectFile::symbol_link_offset(int source_segment, int source_offset, const char* name) {
|
||||
assert((source_offset % 4) == 0);
|
||||
ASSERT((source_offset % 4) == 0);
|
||||
auto& word = words_by_seg.at(source_segment).at(source_offset / 4);
|
||||
assert(word.kind() == LinkedWord::PLAIN_DATA);
|
||||
ASSERT(word.kind() == LinkedWord::PLAIN_DATA);
|
||||
word.set_to_symbol(LinkedWord::SYM_OFFSET, name);
|
||||
}
|
||||
|
||||
@@ -197,15 +197,15 @@ void LinkedObjectFile::pointer_link_split_word(int source_segment,
|
||||
int source_lo_offset,
|
||||
int dest_segment,
|
||||
int dest_offset) {
|
||||
assert((source_hi_offset % 4) == 0);
|
||||
assert((source_lo_offset % 4) == 0);
|
||||
ASSERT((source_hi_offset % 4) == 0);
|
||||
ASSERT((source_lo_offset % 4) == 0);
|
||||
|
||||
auto& hi_word = words_by_seg.at(source_segment).at(source_hi_offset / 4);
|
||||
auto& lo_word = words_by_seg.at(source_segment).at(source_lo_offset / 4);
|
||||
|
||||
// assert(dest_offset / 4 <= (int)words_by_seg.at(dest_segment).size());
|
||||
assert(hi_word.kind() == LinkedWord::PLAIN_DATA);
|
||||
assert(lo_word.kind() == LinkedWord::PLAIN_DATA);
|
||||
// ASSERT(dest_offset / 4 <= (int)words_by_seg.at(dest_segment).size());
|
||||
ASSERT(hi_word.kind() == LinkedWord::PLAIN_DATA);
|
||||
ASSERT(lo_word.kind() == LinkedWord::PLAIN_DATA);
|
||||
|
||||
hi_word.set_to_pointer(LinkedWord::HI_PTR, get_label_id_for(dest_segment, dest_offset));
|
||||
lo_word.set_to_pointer(LinkedWord::LO_PTR, hi_word.label_id());
|
||||
@@ -244,7 +244,7 @@ static const char* segment_names[] = {"main segment", "debug segment", "top-leve
|
||||
std::string LinkedObjectFile::print_words() {
|
||||
std::string result;
|
||||
|
||||
assert(segments <= 3);
|
||||
ASSERT(segments <= 3);
|
||||
for (int seg = segments; seg-- > 0;) {
|
||||
// segment header
|
||||
result += ";------------------------------------------\n; ";
|
||||
@@ -321,7 +321,7 @@ void LinkedObjectFile::find_code() {
|
||||
auto& seg = words_by_seg.front();
|
||||
for (auto& word : seg) {
|
||||
if (word.kind() == LinkedWord::TYPE_PTR) {
|
||||
assert(word.symbol_name() != "function");
|
||||
ASSERT(word.symbol_name() != "function");
|
||||
}
|
||||
}
|
||||
offset_of_data_zone_by_seg.at(0) = 0;
|
||||
@@ -361,8 +361,8 @@ void LinkedObjectFile::find_code() {
|
||||
}
|
||||
}
|
||||
|
||||
assert(found_jr_ra);
|
||||
assert(jr_ra_loc + 1 < words_by_seg.at(i).size());
|
||||
ASSERT(found_jr_ra);
|
||||
ASSERT(jr_ra_loc + 1 < words_by_seg.at(i).size());
|
||||
offset_of_data_zone_by_seg.at(i) = jr_ra_loc + 2;
|
||||
|
||||
} else {
|
||||
@@ -380,7 +380,7 @@ void LinkedObjectFile::find_code() {
|
||||
for (size_t j = offset_of_data_zone_by_seg.at(i); j < words_by_seg.at(i).size(); j++) {
|
||||
auto& word = words_by_seg.at(i).at(j);
|
||||
if (word.kind() == LinkedWord::TYPE_PTR && word.symbol_name() == "function") {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ void LinkedObjectFile::find_code() {
|
||||
}
|
||||
} else {
|
||||
// for files which we couldn't extract link data yet, they will have 0 segments and its ok.
|
||||
assert(segments == 0);
|
||||
ASSERT(segments == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ void LinkedObjectFile::find_code() {
|
||||
void LinkedObjectFile::find_functions() {
|
||||
if (segments == 1) {
|
||||
// it's a v2 file, shouldn't have any functions
|
||||
assert(offset_of_data_zone_by_seg.at(0) == 0);
|
||||
ASSERT(offset_of_data_zone_by_seg.at(0) == 0);
|
||||
} else {
|
||||
// we assume functions don't have any data in between them, so we use the "function" type tag to
|
||||
// mark the end of the previous function and the start of the next. This means that some
|
||||
@@ -422,7 +422,7 @@ void LinkedObjectFile::find_functions() {
|
||||
}
|
||||
|
||||
// mark this as a function, and try again from the current function start
|
||||
assert(found_function_tag_loc);
|
||||
ASSERT(found_function_tag_loc);
|
||||
stats.function_count++;
|
||||
functions_by_seg.at(seg).emplace_back(function_tag_loc, function_end);
|
||||
function_end = function_tag_loc;
|
||||
@@ -506,21 +506,21 @@ void LinkedObjectFile::process_fp_relative_links() {
|
||||
// other cases. Also, the position of the fp register is swapped between the two.
|
||||
case InstructionKind::DADDU:
|
||||
case InstructionKind::ADDU: {
|
||||
assert(prev_instr);
|
||||
ASSERT(prev_instr);
|
||||
if (prev_instr->kind != InstructionKind::ORI) {
|
||||
lg::error("Failed to process fp relative links for (d)addu preceded by: {}",
|
||||
prev_instr->to_string(labels));
|
||||
return;
|
||||
}
|
||||
assert(prev_instr->kind == InstructionKind::ORI);
|
||||
ASSERT(prev_instr->kind == InstructionKind::ORI);
|
||||
int offset_reg_src_id = instr.kind == InstructionKind::DADDU ? 0 : 1;
|
||||
auto offset_reg = instr.get_src(offset_reg_src_id).get_reg();
|
||||
assert(offset_reg == prev_instr->get_dst(0).get_reg());
|
||||
assert(offset_reg == prev_instr->get_src(0).get_reg());
|
||||
ASSERT(offset_reg == prev_instr->get_dst(0).get_reg());
|
||||
ASSERT(offset_reg == prev_instr->get_src(0).get_reg());
|
||||
auto& atom = prev_instr->get_imm_src();
|
||||
int additional_offset = 0;
|
||||
if (pprev_instr && pprev_instr->kind == InstructionKind::LUI) {
|
||||
assert(pprev_instr->get_dst(0).get_reg() == offset_reg);
|
||||
ASSERT(pprev_instr->get_dst(0).get_reg() == offset_reg);
|
||||
additional_offset = (1 << 16) * pprev_instr->get_imm_src().get_imm();
|
||||
pprev_instr->get_imm_src().set_label(
|
||||
get_label_id_for(seg, current_fp + atom.get_imm() + additional_offset));
|
||||
@@ -532,7 +532,7 @@ void LinkedObjectFile::process_fp_relative_links() {
|
||||
|
||||
default:
|
||||
printf("unknown fp using op: %s\n", instr.to_string(labels).c_str());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -564,11 +564,11 @@ std::string LinkedObjectFile::print_function_disassembly(Function& func,
|
||||
}
|
||||
|
||||
for (int j = 1; j < 4; j++) {
|
||||
// assert(get_label_at(seg, (func.start_word + i)*4 + j) == -1);
|
||||
// ASSERT(get_label_at(seg, (func.start_word + i)*4 + j) == -1);
|
||||
if (get_label_at(seg, (func.start_word + i) * 4 + j) != -1) {
|
||||
result += "BAD OFFSET LABEL: ";
|
||||
result += labels.at(get_label_at(seg, (func.start_word + i) * 4 + j)).name + "\n";
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ std::string LinkedObjectFile::print_asm_function_disassembly(const std::string&
|
||||
std::string LinkedObjectFile::print_disassembly(bool write_hex) {
|
||||
std::string result;
|
||||
|
||||
assert(segments <= 3);
|
||||
ASSERT(segments <= 3);
|
||||
for (int seg = segments; seg-- > 0;) {
|
||||
// segment header
|
||||
result += ";------------------------------------------\n; ";
|
||||
@@ -819,7 +819,7 @@ std::string LinkedObjectFile::print_scripts() {
|
||||
* Is the object pointed to the empty list?
|
||||
*/
|
||||
bool LinkedObjectFile::is_empty_list(int seg, int byte_idx) {
|
||||
assert((byte_idx % 4) == 0);
|
||||
ASSERT((byte_idx % 4) == 0);
|
||||
auto& word = words_by_seg.at(seg).at(byte_idx / 4);
|
||||
return word.kind() == LinkedWord::EMPTY_PTR;
|
||||
}
|
||||
@@ -857,7 +857,7 @@ goos::Object LinkedObjectFile::to_form_script(int seg, int word_idx, std::vector
|
||||
return result;
|
||||
} else {
|
||||
// cdr object should be aligned.
|
||||
assert((cdr_addr % 4) == 0);
|
||||
ASSERT((cdr_addr % 4) == 0);
|
||||
auto& cdr_word = words_by_seg.at(seg).at(cdr_addr / 4);
|
||||
// check for proper list
|
||||
if (cdr_word.kind() == LinkedWord::PTR &&
|
||||
@@ -875,7 +875,7 @@ goos::Object LinkedObjectFile::to_form_script(int seg, int word_idx, std::vector
|
||||
}
|
||||
} else {
|
||||
// improper list, should be impossible to get here because of earlier checks
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ goos::Object LinkedObjectFile::to_form_script_object(int seg,
|
||||
std::string debug;
|
||||
append_word_to_string(debug, word);
|
||||
printf("don't know how to print %s\n", debug.c_str());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -944,21 +944,21 @@ goos::Object LinkedObjectFile::to_form_script_object(int seg,
|
||||
default:
|
||||
// pointers should be aligned!
|
||||
printf("align %d\n", byte_idx & 7);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
u32 LinkedObjectFile::read_data_word(const DecompilerLabel& label) {
|
||||
assert(0 == (label.offset % 4));
|
||||
ASSERT(0 == (label.offset % 4));
|
||||
auto& word = words_by_seg.at(label.target_segment).at(label.offset / 4);
|
||||
assert(word.kind() == LinkedWord::Kind::PLAIN_DATA);
|
||||
ASSERT(word.kind() == LinkedWord::Kind::PLAIN_DATA);
|
||||
return word.data;
|
||||
}
|
||||
|
||||
std::string LinkedObjectFile::get_goal_string_by_label(const DecompilerLabel& label) const {
|
||||
assert(0 == (label.offset % 4));
|
||||
ASSERT(0 == (label.offset % 4));
|
||||
return get_goal_string(label.target_segment, (label.offset / 4) - 1, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "decompiler/util/DecompilerTypeSystem.h"
|
||||
#include "common/link_types.h"
|
||||
#include "common/util/BitUtils.h"
|
||||
#include "common/util/assert.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
namespace decompiler {
|
||||
// There are three link versions:
|
||||
@@ -133,9 +133,9 @@ static uint32_t c_symlink2(LinkedObjectFile& f,
|
||||
} else {
|
||||
// offset link - replace lower 16 bits with symbol table offset.
|
||||
|
||||
assert((code_value & 0xffff) == 0 || (code_value & 0xffff) == 0xffff);
|
||||
assert(kind == SymbolLinkKind::SYMBOL);
|
||||
// assert(false); // this case does not occur in V2/V4. It does in V3.
|
||||
ASSERT((code_value & 0xffff) == 0 || (code_value & 0xffff) == 0xffff);
|
||||
ASSERT(kind == SymbolLinkKind::SYMBOL);
|
||||
// ASSERT(false); // this case does not occur in V2/V4. It does in V3.
|
||||
f.symbol_link_offset(seg_id, code_ptr_offset - initial_offset, name);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ static uint32_t c_symlink3(LinkedObjectFile& f,
|
||||
f.symbol_link_word(seg, code_ptr - initial_offset, name, word_kind);
|
||||
} else {
|
||||
f.stats.v3_symbol_link_offset++;
|
||||
assert(kind == SymbolLinkKind::SYMBOL);
|
||||
ASSERT(kind == SymbolLinkKind::SYMBOL);
|
||||
f.symbol_link_offset(seg, code_ptr - initial_offset, name);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
const std::string& name,
|
||||
DecompilerTypeSystem& dts) {
|
||||
const auto* header = (const LinkHeaderV4*)&data.at(0);
|
||||
assert(header->version == 4 || header->version == 2);
|
||||
ASSERT(header->version == 4 || header->version == 2);
|
||||
|
||||
// these are different depending on the version.
|
||||
uint32_t code_offset, link_data_offset, code_size;
|
||||
@@ -241,7 +241,7 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
code_offset = header->length;
|
||||
// we have to compute the code size ourself
|
||||
code_size = data.size() - code_offset;
|
||||
assert(header->type_tag == 0xffffffff);
|
||||
ASSERT(header->type_tag == 0xffffffff);
|
||||
}
|
||||
|
||||
f.stats.total_code_bytes += code_size;
|
||||
@@ -251,7 +251,7 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
const uint8_t* code_start = &data.at(code_offset);
|
||||
const uint8_t* code_end =
|
||||
&data.at(code_offset + code_size - 1) + 1; // get the pointer to one past the end.
|
||||
assert(((code_end - code_start) % 4) == 0);
|
||||
ASSERT(((code_end - code_start) % 4) == 0);
|
||||
f.set_segment_count(1);
|
||||
for (auto x = code_start; x < code_end; x += 4) {
|
||||
f.push_back_word_to_segment(*((const uint32_t*)x), 0);
|
||||
@@ -262,9 +262,9 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
uint32_t link_ptr_offset = link_data_offset;
|
||||
link_ptr_offset += sizeof(LinkHeaderV2);
|
||||
auto* link_header_v2 = (const LinkHeaderV2*)(link_data);
|
||||
assert(link_header_v2->type_tag == 0xffffffff);
|
||||
assert(link_header_v2->version == 2);
|
||||
assert(link_header_v2->length == header->length);
|
||||
ASSERT(link_header_v2->type_tag == 0xffffffff);
|
||||
ASSERT(link_header_v2->version == 2);
|
||||
ASSERT(link_header_v2->length == header->length);
|
||||
f.stats.total_v2_link_bytes += link_header_v2->length;
|
||||
|
||||
// first "section" of link data is a list of where all the pointer are.
|
||||
@@ -341,7 +341,7 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
// always happens.
|
||||
link_ptr_offset--;
|
||||
} else {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
s_name = (const char*)(&data.at(link_ptr_offset));
|
||||
@@ -360,12 +360,12 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
// just be on the safe side.
|
||||
// (see the !symbolValue case in intern_type_from_c)
|
||||
} else {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (std::string("_empty_") == s_name) {
|
||||
assert(kind == SymbolLinkKind::SYMBOL);
|
||||
ASSERT(kind == SymbolLinkKind::SYMBOL);
|
||||
kind = SymbolLinkKind::EMPTY_LIST;
|
||||
}
|
||||
|
||||
@@ -378,10 +378,10 @@ static void link_v2_or_v4(LinkedObjectFile& f,
|
||||
}
|
||||
|
||||
// check length
|
||||
assert(link_header_v2->length == align64(link_ptr_offset - link_data_offset + 1));
|
||||
ASSERT(link_header_v2->length == align64(link_ptr_offset - link_data_offset + 1));
|
||||
size_t expected_end = header->version == 4 ? data.size() : link_header_v2->length;
|
||||
while (link_ptr_offset < expected_end) {
|
||||
assert(data.at(link_ptr_offset) == 0);
|
||||
ASSERT(data.at(link_ptr_offset) == 0);
|
||||
link_ptr_offset++;
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,7 @@ static void assert_string_empty_after(const char* str, int size) {
|
||||
while (*ptr)
|
||||
ptr++;
|
||||
while (ptr - str < size) {
|
||||
assert(!*ptr);
|
||||
ASSERT(!*ptr);
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
@@ -405,11 +405,11 @@ static void link_v5(LinkedObjectFile& f,
|
||||
printf("abandon %s!\n", name.c_str());
|
||||
return;
|
||||
}
|
||||
assert(header->type_tag == 0);
|
||||
assert(name == header->name);
|
||||
assert(header->n_segments == 3);
|
||||
assert(header->pad == 0x50);
|
||||
assert(header->length_to_get_to_code - header->link_length == 0x50);
|
||||
ASSERT(header->type_tag == 0);
|
||||
ASSERT(name == header->name);
|
||||
ASSERT(header->n_segments == 3);
|
||||
ASSERT(header->pad == 0x50);
|
||||
ASSERT(header->length_to_get_to_code - header->link_length == 0x50);
|
||||
|
||||
f.set_segment_count(3);
|
||||
|
||||
@@ -433,15 +433,15 @@ static void link_v5(LinkedObjectFile& f,
|
||||
for (int i = 0; i < 3; i++) {
|
||||
segment_data_offsets[i] = data_ptr_offset + header->segment_info[i].data;
|
||||
segment_link_offsets[i] = header->segment_info[i].relocs + 0x50;
|
||||
assert(header->segment_info[i].magic == 1);
|
||||
ASSERT(header->segment_info[i].magic == 1);
|
||||
}
|
||||
|
||||
// check that the data region is filled
|
||||
for (int i = 0; i < 2; i++) {
|
||||
assert(align16(segment_data_offsets[i] + header->segment_info[i].size) ==
|
||||
ASSERT(align16(segment_data_offsets[i] + header->segment_info[i].size) ==
|
||||
segment_data_offsets[i + 1]);
|
||||
}
|
||||
assert(align16(segment_data_offsets[2] + header->segment_info[2].size) == data.size());
|
||||
ASSERT(align16(segment_data_offsets[2] + header->segment_info[2].size) == data.size());
|
||||
|
||||
// loop over segments (reverse order for now)
|
||||
for (int seg_id = 3; seg_id-- > 0;) {
|
||||
@@ -471,8 +471,8 @@ static void link_v5(LinkedObjectFile& f,
|
||||
auto data_ptr = base_ptr - 4;
|
||||
auto link_ptr = segment_link_offsets[seg_id];
|
||||
|
||||
assert((data_ptr % 4) == 0);
|
||||
assert((segment_size % 4) == 0);
|
||||
ASSERT((data_ptr % 4) == 0);
|
||||
ASSERT((segment_size % 4) == 0);
|
||||
|
||||
auto code_start = (const uint32_t*)(&data.at(data_ptr + 4));
|
||||
auto code_end = ((const uint32_t*)(&data.at(data_ptr + segment_size))) + 1;
|
||||
@@ -503,10 +503,10 @@ static void link_v5(LinkedObjectFile& f,
|
||||
f.stats.v3_split_pointers++;
|
||||
auto dest_seg = (old_code >> 8) & 0xf;
|
||||
auto lo_hi_offset = (old_code >> 12) & 0xf;
|
||||
assert(lo_hi_offset);
|
||||
assert(dest_seg < 3);
|
||||
ASSERT(lo_hi_offset);
|
||||
ASSERT(dest_seg < 3);
|
||||
auto offset_upper = old_code & 0xff;
|
||||
// assert(offset_upper == 0);
|
||||
// ASSERT(offset_upper == 0);
|
||||
uint32_t low_code = *(const uint32_t*)(&data.at(data_ptr + 4 * lo_hi_offset));
|
||||
uint32_t offset = low_code & 0xffff;
|
||||
if (offset_upper) {
|
||||
@@ -560,7 +560,7 @@ static void link_v5(LinkedObjectFile& f,
|
||||
SymbolLinkKind::SYMBOL, sname, seg_id, dts);
|
||||
}
|
||||
} else if ((reloc & 0x3f) == 0x3f) {
|
||||
assert(false); // todo, does this ever get hit?
|
||||
ASSERT(false); // todo, does this ever get hit?
|
||||
} else {
|
||||
int n_methods_base = reloc & 0x3f;
|
||||
int n_methods = n_methods_base * 4;
|
||||
@@ -582,21 +582,21 @@ static void link_v5(LinkedObjectFile& f,
|
||||
segment_link_ends[seg_id] = link_ptr;
|
||||
}
|
||||
|
||||
assert(segment_link_offsets[0] == 128);
|
||||
ASSERT(segment_link_offsets[0] == 128);
|
||||
|
||||
if (header->segment_info[0].size) {
|
||||
assert(segment_link_ends[0] + 1 == segment_link_offsets[1]);
|
||||
ASSERT(segment_link_ends[0] + 1 == segment_link_offsets[1]);
|
||||
} else {
|
||||
assert(segment_link_offsets[0] + 2 == segment_link_offsets[1]);
|
||||
ASSERT(segment_link_offsets[0] + 2 == segment_link_offsets[1]);
|
||||
}
|
||||
|
||||
if (header->segment_info[1].size) {
|
||||
assert(segment_link_ends[1] + 1 == segment_link_offsets[2]);
|
||||
ASSERT(segment_link_ends[1] + 1 == segment_link_offsets[2]);
|
||||
} else {
|
||||
assert(segment_link_offsets[1] + 2 == segment_link_offsets[2]);
|
||||
ASSERT(segment_link_offsets[1] + 2 == segment_link_offsets[2]);
|
||||
}
|
||||
|
||||
assert(align16(segment_link_ends[2] + 2) == segment_data_offsets[0]);
|
||||
ASSERT(align16(segment_link_ends[2] + 2) == segment_data_offsets[0]);
|
||||
}
|
||||
|
||||
static void link_v3(LinkedObjectFile& f,
|
||||
@@ -605,14 +605,14 @@ static void link_v3(LinkedObjectFile& f,
|
||||
DecompilerTypeSystem& dts,
|
||||
int game_version) {
|
||||
auto header = (const LinkHeaderV3*)(&data.at(0));
|
||||
assert(name == header->name);
|
||||
assert(header->segments == 3);
|
||||
ASSERT(name == header->name);
|
||||
ASSERT(header->segments == 3);
|
||||
|
||||
f.set_segment_count(3);
|
||||
assert_string_empty_after(header->name, 64);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
assert(header->segment_info[i].magic == 0);
|
||||
ASSERT(header->segment_info[i].magic == 0);
|
||||
// printf(" [%d] %d %d %d %d\n", i, header->segment_info[i].size,
|
||||
// header->segment_info[i].data, header->segment_info[i].magic,
|
||||
// header->segment_info[i].relocs);
|
||||
@@ -631,10 +631,10 @@ static void link_v3(LinkedObjectFile& f,
|
||||
|
||||
// check that the data region is filled
|
||||
for (int i = 0; i < 2; i++) {
|
||||
assert(align16(segment_data_offsets[i] + header->segment_info[i].size) ==
|
||||
ASSERT(align16(segment_data_offsets[i] + header->segment_info[i].size) ==
|
||||
segment_data_offsets[i + 1]);
|
||||
}
|
||||
assert(align16(segment_data_offsets[2] + header->segment_info[2].size) == data.size());
|
||||
ASSERT(align16(segment_data_offsets[2] + header->segment_info[2].size) == data.size());
|
||||
|
||||
// todo - check link region is filled.
|
||||
|
||||
@@ -673,8 +673,8 @@ static void link_v3(LinkedObjectFile& f,
|
||||
auto data_ptr = base_ptr - 4;
|
||||
auto link_ptr = segment_link_offsets[seg_id];
|
||||
|
||||
assert((data_ptr % 4) == 0);
|
||||
assert((segment_size % 4) == 0);
|
||||
ASSERT((data_ptr % 4) == 0);
|
||||
ASSERT((segment_size % 4) == 0);
|
||||
|
||||
auto code_start = (const uint32_t*)(&data.at(data_ptr + 4));
|
||||
auto code_end = ((const uint32_t*)(&data.at(data_ptr + segment_size))) + 1;
|
||||
@@ -705,10 +705,10 @@ static void link_v3(LinkedObjectFile& f,
|
||||
f.stats.v3_split_pointers++;
|
||||
auto dest_seg = (old_code >> 8) & 0xf;
|
||||
auto lo_hi_offset = (old_code >> 12) & 0xf;
|
||||
assert(lo_hi_offset);
|
||||
assert(dest_seg < 3);
|
||||
ASSERT(lo_hi_offset);
|
||||
ASSERT(dest_seg < 3);
|
||||
auto offset_upper = old_code & 0xff;
|
||||
// assert(offset_upper == 0);
|
||||
// ASSERT(offset_upper == 0);
|
||||
uint32_t low_code = *(const uint32_t*)(&data.at(data_ptr + 4 * lo_hi_offset));
|
||||
uint32_t offset = low_code & 0xffff;
|
||||
if (offset_upper) {
|
||||
@@ -759,7 +759,7 @@ static void link_v3(LinkedObjectFile& f,
|
||||
}
|
||||
|
||||
if (std::string("_empty_") == s_name) {
|
||||
assert(kind == SymbolLinkKind::SYMBOL);
|
||||
ASSERT(kind == SymbolLinkKind::SYMBOL);
|
||||
kind = SymbolLinkKind::EMPTY_LIST;
|
||||
}
|
||||
|
||||
@@ -770,21 +770,21 @@ static void link_v3(LinkedObjectFile& f,
|
||||
segment_link_ends[seg_id] = link_ptr;
|
||||
}
|
||||
|
||||
assert(segment_link_offsets[0] == 128);
|
||||
ASSERT(segment_link_offsets[0] == 128);
|
||||
|
||||
if (header->segment_info[0].size) {
|
||||
assert(segment_link_ends[0] + 1 == segment_link_offsets[1]);
|
||||
ASSERT(segment_link_ends[0] + 1 == segment_link_offsets[1]);
|
||||
} else {
|
||||
assert(segment_link_offsets[0] + 2 == segment_link_offsets[1]);
|
||||
ASSERT(segment_link_offsets[0] + 2 == segment_link_offsets[1]);
|
||||
}
|
||||
|
||||
if (header->segment_info[1].size) {
|
||||
assert(segment_link_ends[1] + 1 == segment_link_offsets[2]);
|
||||
ASSERT(segment_link_ends[1] + 1 == segment_link_offsets[2]);
|
||||
} else {
|
||||
assert(segment_link_offsets[1] + 2 == segment_link_offsets[2]);
|
||||
ASSERT(segment_link_offsets[1] + 2 == segment_link_offsets[2]);
|
||||
}
|
||||
|
||||
assert(align16(segment_link_ends[2] + 2) == segment_data_offsets[0]);
|
||||
ASSERT(align16(segment_link_ends[2] + 2) == segment_data_offsets[0]);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -799,16 +799,16 @@ LinkedObjectFile to_linked_object_file(const std::vector<uint8_t>& data,
|
||||
|
||||
// use appropriate linker
|
||||
if (header->version == 3) {
|
||||
assert(header->type_tag == 0);
|
||||
ASSERT(header->type_tag == 0);
|
||||
link_v3(result, data, name, dts, game_version);
|
||||
} else if (header->version == 4 || header->version == 2) {
|
||||
assert(header->type_tag == 0xffffffff);
|
||||
ASSERT(header->type_tag == 0xffffffff);
|
||||
link_v2_or_v4(result, data, name, dts);
|
||||
} else if (header->version == 5) {
|
||||
link_v5(result, data, name, dts);
|
||||
} else {
|
||||
printf("Unsupported version %d\n", header->version);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include "common/common_types.h"
|
||||
#include "common/util/assert.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
namespace decompiler {
|
||||
class LinkedWord {
|
||||
@@ -114,7 +114,7 @@ class LinkedWord {
|
||||
}
|
||||
|
||||
u8 get_byte(int idx) const {
|
||||
assert(kind() == PLAIN_DATA);
|
||||
ASSERT(kind() == PLAIN_DATA);
|
||||
switch (idx) {
|
||||
case 0:
|
||||
return data & 0xff;
|
||||
@@ -125,7 +125,7 @@ class LinkedWord {
|
||||
case 3:
|
||||
return (data >> 24) & 0xff;
|
||||
default:
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -134,12 +134,12 @@ class LinkedWord {
|
||||
Kind kind() const { return m_kind; }
|
||||
|
||||
u32 label_id() const {
|
||||
assert(m_kind == PTR || m_kind == LO_PTR || m_kind == HI_PTR);
|
||||
ASSERT(m_kind == PTR || m_kind == LO_PTR || m_kind == HI_PTR);
|
||||
return m_data_ptr;
|
||||
}
|
||||
|
||||
std::string symbol_name() const {
|
||||
assert(holds_string());
|
||||
ASSERT(holds_string());
|
||||
return (const char*)(m_data_ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ std::string obj_filename_to_name(const std::string& x) {
|
||||
}
|
||||
}
|
||||
|
||||
assert(last_dot > last_slash + 1);
|
||||
assert(last_slash + 1 < x.length());
|
||||
ASSERT(last_dot > last_slash + 1);
|
||||
ASSERT(last_slash + 1 < x.length());
|
||||
return x.substr(last_slash + 1, last_dot - last_slash - 1);
|
||||
}
|
||||
} // namespace
|
||||
@@ -96,13 +96,13 @@ ObjectFileData& ObjectFileDB::lookup_record(const ObjectFileRecord& rec) {
|
||||
|
||||
for (auto& x : obj_files_by_name[rec.name]) {
|
||||
if (x.record.version == rec.version) {
|
||||
assert(x.record.hash == rec.hash);
|
||||
assert(!result);
|
||||
ASSERT(x.record.hash == rec.hash);
|
||||
ASSERT(!result);
|
||||
result = &x;
|
||||
}
|
||||
}
|
||||
|
||||
assert(result);
|
||||
ASSERT(result);
|
||||
return *result;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void ObjectFileDB::load_map_file(const std::string& map_data) {
|
||||
auto kv = dgo_obj_name_map[dgo].find(game_name_with_ag);
|
||||
if (kv != dgo_obj_name_map[dgo].end()) {
|
||||
lg::error("Object {} in dgo {} occurs more than one time.", game_name_with_ag, dgo);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
dgo_obj_name_map[dgo][game_name_with_ag] = mapped_name;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ void ObjectFileDB::get_objs_from_dgo(const std::string& filename, const Config&
|
||||
auto header = reader.read<DgoHeader>();
|
||||
|
||||
auto dgo_base_name = file_util::base_name(filename);
|
||||
assert(header.name == dgo_base_name);
|
||||
ASSERT(header.name == dgo_base_name);
|
||||
assert_string_empty_after(header.name, 60);
|
||||
|
||||
// get all obj files...
|
||||
@@ -226,11 +226,11 @@ void ObjectFileDB::get_objs_from_dgo(const std::string& filename, const Config&
|
||||
reader.ffwd(reader.bytes_left());
|
||||
continue;
|
||||
} else {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(reader.bytes_left() >= obj_header.object_count);
|
||||
ASSERT(reader.bytes_left() >= obj_header.object_count);
|
||||
}
|
||||
|
||||
if (std::string(obj_header.name).find("-ag") != std::string::npos) {
|
||||
@@ -238,7 +238,7 @@ void ObjectFileDB::get_objs_from_dgo(const std::string& filename, const Config&
|
||||
"Object file {} has \"-ag\" in its name. This will break any tools which use this to "
|
||||
"detect an art group",
|
||||
obj_header.name);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
auto name = get_object_file_name(obj_header.name, reader.here(), obj_header.object_count);
|
||||
@@ -249,7 +249,7 @@ void ObjectFileDB::get_objs_from_dgo(const std::string& filename, const Config&
|
||||
}
|
||||
|
||||
// check we're at the end
|
||||
assert(0 == reader.bytes_left());
|
||||
ASSERT(0 == reader.bytes_left());
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -270,7 +270,7 @@ void ObjectFileDB::add_obj_from_dgo(const std::string& obj_name,
|
||||
}
|
||||
}
|
||||
stats.total_obj_files++;
|
||||
assert(obj_size > 128);
|
||||
ASSERT(obj_size > 128);
|
||||
uint16_t version = *(const uint16_t*)(obj_data + 8);
|
||||
auto hash = file_util::crc32(obj_data, obj_size);
|
||||
|
||||
@@ -279,12 +279,12 @@ void ObjectFileDB::add_obj_from_dgo(const std::string& obj_name,
|
||||
for (auto& e : obj_files_by_name[obj_name]) {
|
||||
if (e.data.size() == obj_size && e.record.hash == hash) {
|
||||
// just to make sure we don't have a hash collision.
|
||||
assert(!memcmp(obj_data, e.data.data(), obj_size));
|
||||
ASSERT(!memcmp(obj_data, e.data.data(), obj_size));
|
||||
|
||||
// already got it!
|
||||
e.reference_count++;
|
||||
auto& rec = e.record;
|
||||
assert(name_in_dgo == e.name_in_dgo);
|
||||
ASSERT(name_in_dgo == e.name_in_dgo);
|
||||
e.dgo_names.push_back(dgo_name);
|
||||
obj_files_by_dgo[dgo_name].push_back(rec);
|
||||
duplicated = true;
|
||||
@@ -316,13 +316,13 @@ void ObjectFileDB::add_obj_from_dgo(const std::string& obj_name,
|
||||
auto dgo_kv = dgo_obj_name_map.find(strip_dgo_extension(dgo_name));
|
||||
if (dgo_kv == dgo_obj_name_map.end()) {
|
||||
lg::error("Object {} is from DGO {}, but this DGO was not in the map.", obj_name, dgo_name);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
auto name_kv = dgo_kv->second.find(obj_name);
|
||||
if (name_kv == dgo_kv->second.end()) {
|
||||
lg::error("Object {} from DGO {} was not found in the name map.", obj_name, dgo_name);
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
data.name_from_map = name_kv->second;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ std::string ObjectFileDB::generate_obj_listing(const std::unordered_set<std::str
|
||||
for (auto& x : obj_files_by_name.at(obj_file)) {
|
||||
std::string dgos = "[";
|
||||
for (auto& y : x.dgo_names) {
|
||||
assert(y.length() >= 5);
|
||||
ASSERT(y.length() >= 5);
|
||||
std::string new_str = y == "NO-XGO" ? y : y.substr(0, y.length() - 4);
|
||||
dgos += "\"" + new_str + "\", ";
|
||||
}
|
||||
@@ -603,7 +603,7 @@ std::string ObjectFileDB::process_tpages(TextureDB& tex_db) {
|
||||
}
|
||||
});
|
||||
|
||||
assert(tpage_dir_count <= 1);
|
||||
ASSERT(tpage_dir_count <= 1);
|
||||
|
||||
lg::info("Processed {} / {} textures ({} px) {:.2f}% in {:.2f} ms", success, total, total_px,
|
||||
100.f * float(success) / float(total), timer.getMs());
|
||||
@@ -631,7 +631,7 @@ std::string ObjectFileDB::process_game_text_files(GameTextVersion version) {
|
||||
string_count += statistics.total_text;
|
||||
char_count += statistics.total_chars;
|
||||
if (text_by_language_by_id.find(statistics.language) != text_by_language_by_id.end()) {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
text_by_language_by_id[statistics.language] = std::move(statistics.text);
|
||||
}
|
||||
@@ -653,7 +653,7 @@ std::string ObjectFileDB::process_game_count_file() {
|
||||
|
||||
for_each_obj([&](ObjectFileData& data) {
|
||||
if (data.name_in_dgo == "game-cnt") {
|
||||
assert(!found);
|
||||
ASSERT(!found);
|
||||
found = true;
|
||||
result = write_game_count(process_game_count(data));
|
||||
}
|
||||
@@ -683,10 +683,10 @@ void ObjectFileDB::analyze_functions_ir1(const Config& config) {
|
||||
for_each_obj([&](ObjectFileData& data) {
|
||||
if (data.linked_data.segments == 3) {
|
||||
// the top level segment should have a single function
|
||||
assert(data.linked_data.functions_by_seg.at(2).size() == 1);
|
||||
ASSERT(data.linked_data.functions_by_seg.at(2).size() == 1);
|
||||
|
||||
auto& func = data.linked_data.functions_by_seg.at(2).front();
|
||||
assert(func.guessed_name.empty());
|
||||
ASSERT(func.guessed_name.empty());
|
||||
func.guessed_name.set_as_top_level(data.to_unique_name());
|
||||
func.find_global_function_defs(data.linked_data, dts);
|
||||
func.find_type_defs(data.linked_data, dts);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "common/common_types.h"
|
||||
#include "decompiler/data/TextureDB.h"
|
||||
#include "decompiler/analysis/symbol_def_map.h"
|
||||
#include "common/util/assert.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
namespace decompiler {
|
||||
/*!
|
||||
@@ -125,7 +125,7 @@ class ObjectFileDB {
|
||||
*/
|
||||
template <typename Func>
|
||||
void for_each_obj(Func f) {
|
||||
assert(obj_files_by_name.size() == obj_file_order.size());
|
||||
ASSERT(obj_files_by_name.size() == obj_file_order.size());
|
||||
for (const auto& name : obj_file_order) {
|
||||
for (auto& obj : obj_files_by_name.at(name)) {
|
||||
// lg::info("{}...", name);
|
||||
|
||||
@@ -185,10 +185,10 @@ void ObjectFileDB::ir2_top_level_pass(const Config& config) {
|
||||
for_each_obj([&](ObjectFileData& data) {
|
||||
if (data.linked_data.segments == 3) {
|
||||
// the top level segment should have a single function
|
||||
assert(data.linked_data.functions_by_seg.at(2).size() == 1);
|
||||
ASSERT(data.linked_data.functions_by_seg.at(2).size() == 1);
|
||||
|
||||
auto& func = data.linked_data.functions_by_seg.at(2).front();
|
||||
assert(func.guessed_name.empty());
|
||||
ASSERT(func.guessed_name.empty());
|
||||
func.guessed_name.set_as_top_level(data.to_unique_name());
|
||||
func.find_global_function_defs(data.linked_data, dts);
|
||||
func.find_type_defs(data.linked_data, dts);
|
||||
@@ -224,7 +224,7 @@ void ObjectFileDB::ir2_top_level_pass(const Config& config) {
|
||||
total_unknowns++;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
total_functions++;
|
||||
|
||||
@@ -296,8 +296,8 @@ void ObjectFileDB::ir2_basic_block_pass(int seg, const Config& config, ObjectFil
|
||||
func.analyze_prologue(data.linked_data);
|
||||
} else {
|
||||
// manually exclude the type tag from the basic block.
|
||||
assert(func.basic_blocks.front().start_word == 0);
|
||||
assert(func.basic_blocks.front().end_word >= 1);
|
||||
ASSERT(func.basic_blocks.front().start_word == 0);
|
||||
ASSERT(func.basic_blocks.front().end_word >= 1);
|
||||
func.basic_blocks.front().start_word = 1;
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ std::string ObjectFileDB::ir2_to_file(ObjectFileData& data, const Config& config
|
||||
std::string result;
|
||||
|
||||
const char* segment_names[] = {"main segment", "debug segment", "top-level segment"};
|
||||
assert(data.linked_data.segments <= 3);
|
||||
ASSERT(data.linked_data.segments <= 3);
|
||||
for (int seg = data.linked_data.segments; seg-- > 0;) {
|
||||
// segment header
|
||||
result += ";------------------------------------------\n; ";
|
||||
@@ -676,7 +676,7 @@ std::string ObjectFileDB::ir2_to_file(ObjectFileData& data, const Config& config
|
||||
}
|
||||
// check for no misaligned labels in code segments.
|
||||
for (int j = 1; j < 4; j++) {
|
||||
assert(data.linked_data.get_label_at(seg, (func.start_word + instr_idx) * 4 + j) ==
|
||||
ASSERT(data.linked_data.get_label_at(seg, (func.start_word + instr_idx) * 4 + j) ==
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ std::string ObjectFileDB::ir2_function_to_string(ObjectFileData& data, Function&
|
||||
}
|
||||
// check for no misaligned labels in code segments.
|
||||
for (int j = 1; j < 4; j++) {
|
||||
assert(data.linked_data.get_label_at(seg, (func.start_word + i) * 4 + j) == -1);
|
||||
ASSERT(data.linked_data.get_label_at(seg, (func.start_word + i) * 4 + j) == -1);
|
||||
}
|
||||
|
||||
// print the assembly instruction
|
||||
@@ -815,7 +815,7 @@ std::string ObjectFileDB::ir2_function_to_string(ObjectFileData& data, Function&
|
||||
in_delay_slot = true;
|
||||
}
|
||||
total_instructions_printed++;
|
||||
assert(last_instr_printed + 1 == i);
|
||||
ASSERT(last_instr_printed + 1 == i);
|
||||
last_instr_printed = i;
|
||||
};
|
||||
|
||||
@@ -909,7 +909,7 @@ std::string ObjectFileDB::ir2_function_to_string(ObjectFileData& data, Function&
|
||||
|
||||
result += "\n";
|
||||
|
||||
assert(total_instructions_printed == (func.end_word - func.start_word - 1));
|
||||
ASSERT(total_instructions_printed == (func.end_word - func.start_word - 1));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -983,7 +983,7 @@ bool ObjectFileDB::lookup_function_type(const FunctionName& name,
|
||||
mi.type.substitute_for_method_call(name.type_name));
|
||||
return true;
|
||||
} else {
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -994,7 +994,7 @@ std::string ObjectFileDB::ir2_final_out(ObjectFileData& data,
|
||||
std::string result;
|
||||
result += ";;-*-Lisp-*-\n";
|
||||
result += "(in-package goal)\n\n";
|
||||
assert(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).size() == 1);
|
||||
ASSERT(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).size() == 1);
|
||||
auto top_level = data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).at(0);
|
||||
result += write_from_top_level(top_level, dts, data.linked_data, skip_functions);
|
||||
result += "\n\n";
|
||||
|
||||
Reference in New Issue
Block a user