mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2026-04-30 14:02:14 +00:00
Emit dummy value if relocatable_sections_ordered is empty
This commit is contained in:
parent
f32e47f930
commit
a97bd793a7
1 changed files with 15 additions and 11 deletions
26
src/main.cpp
26
src/main.cpp
|
|
@ -1736,18 +1736,22 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
|
|
||||||
fmt::print(overlay_file, "static int overlay_sections_by_index[] = {{\n");
|
fmt::print(overlay_file, "static int overlay_sections_by_index[] = {{\n");
|
||||||
for (const std::string& section : relocatable_sections_ordered) {
|
if (relocatable_sections_ordered.empty()) {
|
||||||
// Check if this is an empty overlay
|
fmt::print(overlay_file, " -1,\n");
|
||||||
if (section == "*") {
|
} else {
|
||||||
fmt::print(overlay_file, " -1,\n");
|
for (const std::string& section : relocatable_sections_ordered) {
|
||||||
}
|
// Check if this is an empty overlay
|
||||||
else {
|
if (section == "*") {
|
||||||
auto find_it = relocatable_section_indices.find(section);
|
fmt::print(overlay_file, " -1,\n");
|
||||||
if (find_it == relocatable_section_indices.end()) {
|
}
|
||||||
fmt::print(stderr, "Failed to find written section index of relocatable section: {}\n", section);
|
else {
|
||||||
std::exit(EXIT_FAILURE);
|
auto find_it = relocatable_section_indices.find(section);
|
||||||
|
if (find_it == relocatable_section_indices.end()) {
|
||||||
|
fmt::print(stderr, "Failed to find written section index of relocatable section: {}\n", section);
|
||||||
|
std::exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
fmt::print(overlay_file, " {},\n", relocatable_section_indices[section]);
|
||||||
}
|
}
|
||||||
fmt::print(overlay_file, " {},\n", relocatable_section_indices[section]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt::print(overlay_file, "}};\n");
|
fmt::print(overlay_file, "}};\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue