Skip to content

Commit

Permalink
Convert demangling error to assertion
Browse files Browse the repository at this point in the history
We don't ever expect to encounter it, so assert conveys the intent better
  • Loading branch information
sgizler committed Oct 9, 2024
1 parent b98c220 commit 93e2be4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions source/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
std::string tryDemangle(const char* mangled) {
int rc;
char* out = abi::__cxa_demangle(mangled, NULL, NULL, &rc);
if (rc != 0) {
PRINTF_ERR("demangling error\n");
exit(1);
}
assert(rc == 0 && "demangling failed");
std::string outStr = out;
free(out);
return outStr;
Expand Down

0 comments on commit 93e2be4

Please sign in to comment.