@@ -242,6 +242,7 @@ R"(#include <stdio.h>
242
242
if (ASR::is_a<ASR::Variable_t>(*var_sym)) {
243
243
ASR::Variable_t *v = ASR::down_cast<ASR::Variable_t>(var_sym);
244
244
std::string decl = self ().convert_variable_decl (*v);
245
+ decl = check_tmp_buffer () + decl;
245
246
bool used_define_for_const = (ASR::is_a<ASR::Const_t>(*v->m_type ) &&
246
247
v->m_intent == ASRUtils::intent_local);
247
248
if (used_define_for_const) {
@@ -300,11 +301,12 @@ R"(#include <stdio.h>
300
301
ASR::symbol_t * var_sym = x.m_symtab ->get_symbol (item);
301
302
if (ASR::is_a<ASR::Variable_t>(*var_sym)) {
302
303
ASR::Variable_t *v = ASR::down_cast<ASR::Variable_t>(var_sym);
303
- decl + = self ().convert_variable_decl (*v);
304
+ std::string d = self ().convert_variable_decl (*v);
304
305
if ( !ASR::is_a<ASR::Const_t>(*v->m_type ) ||
305
306
v->m_intent == ASRUtils::intent_return_var ) {
306
- decl += " ;\n " ;
307
+ d += " ;\n " ;
307
308
}
309
+ decl += check_tmp_buffer () + d;
308
310
}
309
311
}
310
312
@@ -336,11 +338,12 @@ R"(#include <stdio.h>
336
338
ASR::symbol_t * var_sym = block->m_symtab ->get_symbol (item);
337
339
if (ASR::is_a<ASR::Variable_t>(*var_sym)) {
338
340
ASR::Variable_t *v = ASR::down_cast<ASR::Variable_t>(var_sym);
339
- decl + = indent + self ().convert_variable_decl (*v);
341
+ std::string d = indent + self ().convert_variable_decl (*v);
340
342
if ( !ASR::is_a<ASR::Const_t>(*v->m_type ) ||
341
343
v->m_intent == ASRUtils::intent_return_var ) {
342
- decl += " ;\n " ;
344
+ d += " ;\n " ;
343
345
}
346
+ decl += check_tmp_buffer () + d;
344
347
}
345
348
}
346
349
for (size_t i=0 ; i<block->n_body ; i++) {
@@ -539,11 +542,12 @@ R"(#include <stdio.h>
539
542
ASR::Variable_t *v = ASR::down_cast<ASR::Variable_t>(var_sym);
540
543
if (v->m_intent == ASRUtils::intent_local ||
541
544
v->m_intent == ASRUtils::intent_return_var) {
542
- decl + = indent + self ().convert_variable_decl (*v);
545
+ std::string d = indent + self ().convert_variable_decl (*v);
543
546
if ( !ASR::is_a<ASR::Const_t>(*v->m_type ) ||
544
547
v->m_intent == ASRUtils::intent_return_var ) {
545
- decl += " ;\n " ;
548
+ d += " ;\n " ;
546
549
}
550
+ decl += check_tmp_buffer () + d;
547
551
}
548
552
if (ASR::is_a<ASR::TypeParameter_t>(*v->m_type )) {
549
553
has_typevar = true ;
0 commit comments