From 50c43fff4457c41a191075150a6fb91629a14b68 Mon Sep 17 00:00:00 2001 From: Shaikh Ubaid Date: Tue, 18 Jul 2023 23:45:56 +0530 Subject: [PATCH] C_CPP: Visit the expression in construct_call_args() --- src/libasr/codegen/asr_to_c_cpp.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libasr/codegen/asr_to_c_cpp.h b/src/libasr/codegen/asr_to_c_cpp.h index 72ea873bea..2619823590 100644 --- a/src/libasr/codegen/asr_to_c_cpp.h +++ b/src/libasr/codegen/asr_to_c_cpp.h @@ -1034,18 +1034,17 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) { bracket_open++; std::string args = ""; for (size_t i=0; i(*m_args[i].m_value)) { - ASR::Variable_t *arg = ASRUtils::EXPR2VAR(m_args[i].m_value); - std::string arg_name = arg->m_name; - if( ASRUtils::is_array(arg->m_type) && - ASRUtils::is_pointer(arg->m_type) ) { - args += "&" + arg_name; + if( ASRUtils::is_array(type) && + ASRUtils::is_pointer(type) ) { + args += "&" + src; } else { - args += arg_name; + args += src; } } else { - self().visit_expr(*m_args[i].m_value); - if( ASR::is_a(*ASRUtils::expr_type(m_args[i].m_value)) ) { + if( ASR::is_a(*type) ) { args += "&" + src; } else { args += src;