We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent baafdce commit b2a8610Copy full SHA for b2a8610
1 file changed
src/libasr/pass/global_stmts.cpp
@@ -31,7 +31,7 @@ void pass_wrap_global_stmts(Allocator &al,
31
char *fn_name = s.c_str(al);
32
SymbolTable *fn_scope = al.make_new<SymbolTable>(unit.m_symtab);
33
34
- ASR::ttype_t *type;
+ ASR::ttype_t *type = nullptr;
35
Location loc = unit.base.base.loc;
36
ASR::asr_t *return_var=nullptr;
37
ASR::expr_t *return_var_ref=nullptr;
@@ -82,6 +82,9 @@ void pass_wrap_global_stmts(Allocator &al,
82
83
if (return_var) {
84
// The last defined `return_var` is the actual return value
85
+ LCOMPILERS_ASSERT(type)
86
+ LCOMPILERS_ASSERT(return_var_ref)
87
+
88
ASR::down_cast2<ASR::Variable_t>(return_var)->m_intent = ASRUtils::intent_return_var;
89
std::string global_underscore_name = "_" + fn_name_s;
90
s.from_str(al, global_underscore_name);
0 commit comments