From a504ed3738f3f2bc5ed98b9ba821185e02c16451 Mon Sep 17 00:00:00 2001 From: Alfred Huang Date: Sun, 28 Mar 2021 14:12:44 -0700 Subject: [PATCH] Incorrect fatal checking for C removed --- src/mapleall/maple_be/src/cg/aarch64/aarch64_abi.cpp | 3 --- src/mapleall/maple_be/src/cg/emit.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_abi.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_abi.cpp index 8721114891..27e7ae95da 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_abi.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_abi.cpp @@ -173,9 +173,6 @@ int32 ClassifyAggregate(const BECommon &be, MIRType &mirType, AArch64ArgumentCla if (mirType.GetKind() == kTypeStruct) { MIRStructType &structType = static_cast(mirType); return ProcessStructWhenClassifyAggregate(be, structType, classes, classesLength, fpSize); - } else { - /* mirType->_kind == TYPE_ARRAY */ - CHECK_FATAL(false, "Should not be here"); } /* post merger clean-up */ for (i = 0; i < sizeOfTyInDwords; ++i) { diff --git a/src/mapleall/maple_be/src/cg/emit.cpp b/src/mapleall/maple_be/src/cg/emit.cpp index 7f52078eb7..b37b0ea4c9 100644 --- a/src/mapleall/maple_be/src/cg/emit.cpp +++ b/src/mapleall/maple_be/src/cg/emit.cpp @@ -1500,8 +1500,10 @@ void Emitter::EmitArrayConstant(MIRConst &mirConst) { } int64 iNum = (arrayType.GetSizeArrayItem(0) > 0) ? (static_cast(arrayType.GetSizeArrayItem(0))) - uNum : 0; if (iNum > 0) { - CHECK_FATAL(!Globals::GetInstance()->GetBECommon()->IsEmptyOfTypeSizeTable(), "container empty check"); - CHECK_FATAL(!arrayCt.GetConstVec().empty(), "container empty check"); + if (!cg->GetMIRModule()->IsCModule()) { + CHECK_FATAL(!Globals::GetInstance()->GetBECommon()->IsEmptyOfTypeSizeTable(), "container empty check"); + CHECK_FATAL(!arrayCt.GetConstVec().empty(), "container empty check"); + } if (uNum > 0) { uint64 unInSizeInByte = static_cast(iNum) * static_cast( Globals::GetInstance()->GetBECommon()->GetTypeSize(arrayCt.GetConstVecItem(0)->GetType().GetTypeIndex())); -- Gitee