From a668bf698f63608354191fc51a86d68ea36717d4 Mon Sep 17 00:00:00 2001 From: Wen HU Date: Wed, 27 Jul 2022 18:04:13 -0700 Subject: [PATCH] bug fix --- src/mapleall/maple_ir/src/parser.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mapleall/maple_ir/src/parser.cpp b/src/mapleall/maple_ir/src/parser.cpp index d2fdcadff8..a3a49a5b22 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; -- Gitee