File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3791,7 +3791,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
37913791 }
37923792 }
37933793 std::string fn_name;
3794- if (ASRUtils::get_FunctionType (x)->m_abi == ASR::abiType::BindC) {
3794+ if (compiler_options.interactive && startswith (sym_name, " __main__global_stmts" )) {
3795+ fn_name = sym_name;
3796+ } else if (ASRUtils::get_FunctionType (x)->m_abi == ASR::abiType::BindC) {
37953797 if (ASRUtils::get_FunctionType (x)->m_bindc_name ) {
37963798 fn_name = ASRUtils::get_FunctionType (x)->m_bindc_name ;
37973799 } else {
Original file line number Diff line number Diff line change @@ -85,10 +85,8 @@ Result<PythonCompiler::EvalResult> PythonCompiler::evaluate(
8585 }
8686
8787 // ASR -> LLVM
88- std::string module_prefix = " __module___main___" ;
8988 std::string module_name = " __main__" ;
90- std::string sym_name = module_name + " global_stmts_" + std::to_string (eval_count) + " __" ;
91- run_fn = module_prefix + sym_name;
89+ run_fn = module_name + " global_stmts_" + std::to_string (eval_count) + " __" ;
9290
9391 Result<std::unique_ptr<LLVMModule>> res3 = get_llvm3 (*asr,
9492 pass_manager, diagnostics, lm.files .back ().in_filename );
@@ -116,7 +114,7 @@ Result<PythonCompiler::EvalResult> PythonCompiler::evaluate(
116114
117115 if (call_run_fn) {
118116 ASR::down_cast<ASR::Module_t>(symbol_table->resolve_symbol (module_name))->m_symtab
119- ->erase_symbol (sym_name );
117+ ->erase_symbol (run_fn );
120118 }
121119
122120 eval_count++;
You can’t perform that action at this time.
0 commit comments