Skip to content

Commit

Permalink
improve simpleParser error detection (#27)
Browse files Browse the repository at this point in the history
exit -1 if the symtab object failed to be constructed such as
when the path is a non-elf or unreadable file
  • Loading branch information
kupsch authored Apr 10, 2024
1 parent e66b37b commit d84c9ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parseAPI/simpleParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ int main(int argc, char* argv[]) {

try {
auto* sts = new dp::SymtabCodeSource(argv[1]);
if (!sts->getSymtabObject()) {
std::cerr << "failed to create symtab object\n";
return -1;
}
auto* co = new dp::CodeObject(sts);
co->parse();
} catch(std::exception &e) {
Expand Down

0 comments on commit d84c9ea

Please sign in to comment.