Fix cases of string formatting with non string literals (#3304)

The logger used in `goalc` tries to print an already-formatted string
`message` using `fmt::print(message);` Usually this doesn't cause
problems, but if you try to print, for example, an exception that has
special characters (notably `{`) it will try to do another round of
formatting/replacements, despite not having any args to replace with,
which ends up throwing another exception. This is why errors when
parsing custom level JSON cause the REPL to exit.

I've hopefully identified all the various instances of this across the
codebase
This commit is contained in:
Matt Dallmeyer
2024-01-14 04:02:08 -08:00
committed by GitHub
parent 7a8aa71204
commit 2071c98b55
13 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -224,7 +224,7 @@ InstructionPointerInfo Debugger::get_rip_info(u64 rip) {
void print_and_append_to_string(std::string& str, const std::string& log) {
str += log;
lg::print(log);
lg::print("{}", log);
}
std::vector<BacktraceFrame> Debugger::get_backtrace(u64 rip,