Skip to content

Commit 9090781

Browse files
Check ASR verify
1 parent 12de970 commit 9090781

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libasr/pass/global_stmts.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ void pass_wrap_global_vars_into_function(ASR::TranslationUnit_t &unit) {
170170
for (auto &a: symbols) {
171171
unit.m_global_scope->erase_symbol(a);
172172
}
173+
#if defined(WITH_LFORTRAN_ASSERT)
174+
diag::Diagnostics diagnostics;
175+
if (!asr_verify(unit, true, diagnostics)) {
176+
std::cerr << diagnostics.render2();
177+
throw LCompilersException("Verify failed");
178+
};
179+
#endif
173180
}
174181

175182
} // namespace LCompilers

0 commit comments

Comments
 (0)