Skip to content

Commit

Permalink
DEV: Use combination of std::cerr and exit(EXIT_FAILURE) for robust r…
Browse files Browse the repository at this point in the history
…eference testing of errors
  • Loading branch information
czgdp1807 committed Mar 20, 2024
1 parent 2c96a3f commit 17da678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lc/clang_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,8 @@ class ClangASTtoASRVisitor: public clang::RecursiveASTVisitor<ClangASTtoASRVisit
if( op == clang::BO_Assign ) {
std::string symbol_name = "";
if( is_read_only(x_lhs, symbol_name) ) {
throw std::runtime_error(symbol_name + " is marked as read only.");
std::cerr << symbol_name + " is marked as read only." << std::endl;
exit(EXIT_FAILURE);
}
cast_helper(x_lhs, x_rhs, true);
ASRUtils::make_ArrayBroadcast_t_util(al, Lloc(x), x_lhs, x_rhs);
Expand Down

0 comments on commit 17da678

Please sign in to comment.