Skip to content

Commit 73953d6

Browse files
certikanutosh491
authored andcommitted
Do not load CPtr
1 parent 25dfb85 commit 73953d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,12 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
12451245
llvm::Value* const_list = builder->CreateAlloca(const_list_type, nullptr, "const_list");
12461246
list_api->list_init(type_code, const_list, *module, x.n_args, x.n_args);
12471247
int64_t ptr_loads_copy = ptr_loads;
1248-
ptr_loads = 1;
12491248
for( size_t i = 0; i < x.n_args; i++ ) {
1249+
if (ASR::is_a<ASR::CPtr_t>(*ASRUtils::expr_type(x.m_args[i]))) {
1250+
ptr_loads = 0;
1251+
} else {
1252+
ptr_loads = 1;
1253+
}
12501254
this->visit_expr(*x.m_args[i]);
12511255
llvm::Value* item = tmp;
12521256
llvm::Value* pos = llvm::ConstantInt::get(context, llvm::APInt(32, i));

0 commit comments

Comments
 (0)