Skip to content

Commit 029f395

Browse files
committed
C: Fix passing pointer to array
1 parent 179d0f7 commit 029f395

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libasr/codegen/asr_to_c_cpp.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,9 +1073,7 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
10731073
ASR::is_a<ASR::Variable_t>(
10741074
*(ASR::down_cast<ASR::Var_t>(m_args[i].m_value)->m_v))) {
10751075
ASR::Variable_t* param = ASRUtils::EXPR2VAR(f->m_args[i]);
1076-
if( (ASRUtils::is_array(type) &&
1077-
ASRUtils::is_pointer(type))
1078-
|| (is_c && (param->m_intent == ASRUtils::intent_inout
1076+
if( (is_c && (param->m_intent == ASRUtils::intent_inout
10791077
|| param->m_intent == ASRUtils::intent_out)
10801078
&& !ASRUtils::is_aggregate_type(param->m_type))) {
10811079
args += "&" + src;

0 commit comments

Comments
 (0)