Skip to content

Commit d2f51d6

Browse files
kmr-srbhubaidsk
andcommitted
Check for no arguments
Co-authored-by: Shaikh Ubaid <[email protected]>
1 parent 00b9b19 commit d2f51d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libasr/pass/intrinsic_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4673,7 +4673,7 @@ static inline void verify_args(const ASR::IntrinsicElementalFunction_t& x, diag:
46734673

46744674
static inline ASR::expr_t *eval_list_pop(Allocator &/*al*/,
46754675
const Location &/*loc*/, ASR::ttype_t */*t*/, Vec<ASR::expr_t*>& args, diag::Diagnostics& /*diag*/) {
4676-
if (args[0] == nullptr) {
4676+
if (args.n == 0 || args[0] == nullptr) {
46774677
return nullptr;
46784678
}
46794679
ASR::ListConstant_t* clist = ASR::down_cast<ASR::ListConstant_t>(args[0]);

0 commit comments

Comments
 (0)