Skip to content

Commit 62e5ead

Browse files
authored
LLVM: added a null check (#1985)
1 parent 336168b commit 62e5ead

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5134,6 +5134,11 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
51345134
}
51355135

51365136
inline void visit_expr_wrapper(ASR::expr_t* x, bool load_ref=false) {
5137+
// Check if *x is nullptr.
5138+
if( x == nullptr ) {
5139+
throw CodeGenError("Internal error: x is nullptr");
5140+
}
5141+
51375142
this->visit_expr(*x);
51385143
if( x->type == ASR::exprType::ArrayItem ||
51395144
x->type == ASR::exprType::ArraySection ||

0 commit comments

Comments
 (0)