Skip to content

Commit

Permalink
Add Seg fault support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh0g0-1758 committed Apr 18, 2024
1 parent cb1cdef commit 5b8dd76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions RunTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ echo "./../Input/error_program4.txt" | ./assembler
echo "./../Input/error_program5.txt" | ./assembler
cd tests
./assembler_test

2 changes: 1 addition & 1 deletion src/assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main() {
if (!has_end) {
string err_msg = "END statement not found.";
save_error_msg(err_msg, RECORD_FILE_NAME);
exit(0);
raise(SIGSEGV);
}
BLOCK_TABLE[CURR_BLOCK_NAME].second = LOCCTR;
if (LIT_INTERMEDIATE.size() != 0) {
Expand Down

0 comments on commit 5b8dd76

Please sign in to comment.