Improve ASSERT macro, fix linux file paths in Taskfile and hopefully fix the windows release (#1295)

* ci: fix windows releases (hopefully)

* scripts: fix Taskfile file references for linux

* asserts: add `ASSERT_MSG` macro and ensure `stdout` is flushed before `abort`ing

* asserts: refactor all `assert(false);` with a preceeding message instances

* lint: format

* temp...

* fix compiler errors

* assert: allow for string literals in `ASSERT_MSG`

* lint: formatting

* revert temp change for testing
This commit is contained in:
Tyler Wilding
2022-04-12 18:48:27 -04:00
committed by GitHub
parent b263e33e94
commit c4a92571b2
51 changed files with 187 additions and 226 deletions
+4 -6
View File
@@ -530,8 +530,8 @@ void LinkedObjectFile::process_fp_relative_links() {
} break;
default:
printf("unknown fp using op: %s\n", instr.to_string(labels).c_str());
ASSERT(false);
ASSERT_MSG(false,
fmt::format("unknown fp using op: {}", instr.to_string(labels).c_str()));
}
}
}
@@ -912,16 +912,14 @@ goos::Object LinkedObjectFile::to_form_script_object(int seg,
} else {
std::string debug;
append_word_to_string(debug, word);
printf("don't know how to print %s\n", debug.c_str());
ASSERT(false);
ASSERT_MSG(false, fmt::format("don't know how to print {}", debug.c_str()));
}
} break;
case 2: // bad, a pair snuck through.
default:
// pointers should be aligned!
printf("align %d\n", byte_idx & 7);
ASSERT(false);
ASSERT_MSG(false, fmt::format("align {}", byte_idx & 7));
}
return result;