File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -574,6 +574,8 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
574574 // True for the main module, false for every other one
575575 // The main module is stored directly in TranslationUnit, other modules are Modules
576576 bool main_module;
577+ // This is the current module name that we are compiling from AST to ASR
578+ // It is an empty string for main_module
577579 std::string module_name;
578580 PythonIntrinsicProcedures intrinsic_procedures;
579581 ProceduresDatabase procedures_db;
@@ -3818,6 +3820,7 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
38183820 void visit_Module (const AST::Module_t &x) {
38193821 ASR::asr_t *tmp0 = nullptr ;
38203822 if (current_scope) {
3823+ LCOMPILERS_ASSERT (current_scope->asr_owner );
38213824 tmp0 = current_scope->asr_owner ;
38223825 } else {
38233826 current_scope = al.make_new <SymbolTable>(nullptr );
@@ -3827,6 +3830,7 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
38273830 tmp0 = ASR::make_TranslationUnit_t (al, x.base .base .loc ,
38283831 current_scope, nullptr , 0 );
38293832 }
3833+ LCOMPILERS_ASSERT (ASR::is_a<ASR::TranslationUnit_t>(*tmp0));
38303834 global_scope = current_scope;
38313835
38323836 ASR::Module_t* module_sym = nullptr ;
You can’t perform that action at this time.
0 commit comments