diff --git a/src/mapleall/maple_ir/src/parser.cpp b/src/mapleall/maple_ir/src/parser.cpp index d2fdcadff8b8cfa20820336dfdc29f1f3b0f311f..a3a49a5b22bf6a5e4e80df36c6130b6ddba3a0be 100644 --- a/src/mapleall/maple_ir/src/parser.cpp +++ b/src/mapleall/maple_ir/src/parser.cpp @@ -2579,12 +2579,10 @@ bool MIRParser::ParseOneScope(MIRScope &scope) { bool MIRParser::ParseScope() { MIRScope *scp = nullptr; MIRFunction *func = mod.CurFunction(); - CHECK_NULL_FATAL(func); - // check if the first dummy function - if (func->GetPuidxOrigin() == 1) { - scp = mod.GetScope(); - } else { + if (func && func->GetBody()) { scp = func->GetScope(); + } else { + scp = mod.GetScope(); } bool status = ParseOneScope(*scp); return status;