Skip to content

Commit 80968be

Browse files
committed
C_CPP: Fix pass struct by ref
1 parent 768e809 commit 80968be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libasr/codegen/asr_to_c_cpp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
26182618
}
26192619
} else {
26202620
self().visit_expr(*x.m_args[i].m_value);
2621-
if( ASR::is_a<ASR::ArrayItem_t>(*x.m_args[i].m_value) &&
2621+
if( ASR::is_a<ASR::ArrayItem_t>(*x.m_args[i].m_value) ||
26222622
ASR::is_a<ASR::Struct_t>(*ASRUtils::expr_type(x.m_args[i].m_value)) ) {
26232623
out += "&" + src;
26242624
} else {

0 commit comments

Comments
 (0)