diff --git a/src/mapleall/maple_ir/src/bin_mpl_import.cpp b/src/mapleall/maple_ir/src/bin_mpl_import.cpp index 9a3645c0c889e4245de8f1c7c321cddab13a5d43..73077f9b06eff9cba6591c55f28f82e3abd0ece1 100644 --- a/src/mapleall/maple_ir/src/bin_mpl_import.cpp +++ b/src/mapleall/maple_ir/src/bin_mpl_import.cpp @@ -509,7 +509,7 @@ void BinaryMplImport::CompleteAggInfo(TyIdx tyIdx) { auto *classType = static_cast(type); ImportStructTypeData(*classType); ImportClassTypeData(*classType); - } else if (type->GetKind() == kTypeStruct) { + } else if (type->GetKind() == kTypeStruct || type->GetKind() == kTypeUnion) { auto *structType = static_cast(type); ImportStructTypeData(*structType); } else { @@ -741,7 +741,7 @@ MIRType &BinaryMplImport::InsertInTypeTables(MIRType &type) { (!IsIncomplete(*prevType) && !IsIncomplete(type)) || (!IsIncomplete(*prevType) && IsIncomplete(type)))) { resultTypePtr = prevType->CopyMIRTypeNode(); - if (resultTypePtr->GetKind() == kTypeStruct || resultTypePtr->GetKind() == kTypeStructIncomplete) { + if (resultTypePtr->GetKind() == kTypeStruct || resultTypePtr->GetKind() == kTypeUnion || resultTypePtr->GetKind() == kTypeStructIncomplete) { tmpStruct.push_back(static_cast(resultTypePtr)); } else if (resultTypePtr->GetKind() == kTypeClass || resultTypePtr->GetKind() == kTypeClassIncomplete) { tmpClass.push_back(static_cast(resultTypePtr)); diff --git a/src/mapleall/maple_ir/src/mir_function.cpp b/src/mapleall/maple_ir/src/mir_function.cpp index 46a5384bee9d57a84df33092432b12e1765431bc..42195d17dfbb4ec4ec505708e757555d1a26e3a0 100644 --- a/src/mapleall/maple_ir/src/mir_function.cpp +++ b/src/mapleall/maple_ir/src/mir_function.cpp @@ -297,7 +297,8 @@ void MIRFunction::Dump(bool withoutBody) { // class and interface decls. these has nothing in formals // they do have paramtypelist_. this can not skip ones without args // but for them at least the func decls are valid - if (GetParamSize() != formalDefVec.size() || GetAttr(FUNCATTR_optimized)) { + if ((module->IsJavaModule() && GetParamSize() != formalDefVec.size()) || + GetAttr(FUNCATTR_optimized)) { return; } diff --git a/src/mapleall/maple_ir/src/mir_nodes.cpp b/src/mapleall/maple_ir/src/mir_nodes.cpp index bfffaa1fa2a03a8b5444a6961699360f555359d0..c02fe724b3954924e594fa514b21d7c6d06641bb 100644 --- a/src/mapleall/maple_ir/src/mir_nodes.cpp +++ b/src/mapleall/maple_ir/src/mir_nodes.cpp @@ -166,6 +166,9 @@ void BlockNode::AddStatement(StmtNode *stmt) { } void BlockNode::AppendStatementsFromBlock(BlockNode &blk) { + if (blk.GetStmtNodes().empty()) { + return; + } stmtNodeList.splice(stmtNodeList.end(), blk.GetStmtNodes()); }