diff --git a/src/mapleall/maple_ir/src/mir_nodes.cpp b/src/mapleall/maple_ir/src/mir_nodes.cpp index 2be22a775df938e279e258a65bfaccc2c6c5d440..05b27f67950307f44f5664e10da20cc7df8f9571 100644 --- a/src/mapleall/maple_ir/src/mir_nodes.cpp +++ b/src/mapleall/maple_ir/src/mir_nodes.cpp @@ -1431,7 +1431,11 @@ bool UnaryNode::Verify() const { // When an opcode only specifies one type, check for compatibility // between the operands and the result-type. - bool compVerf = CompatibleTypeVerify(*uOpnd, *this); + bool compVerf = true; + // op_alloca : return type is not compatible with operand, skip + if (GetOpCode() != OP_alloca) { + compVerf = CompatibleTypeVerify(*uOpnd, *this); + } bool opndExprVerf = uOpnd->Verify(); return resTypeVerf && compVerf && opndExprVerf; } diff --git a/src/mapleall/mpl2mpl/src/constantfold.cpp b/src/mapleall/mpl2mpl/src/constantfold.cpp index 95e7aa1dd9bad14bf57443dc86e5428eab120a57..c5901c90381602bba9eafbaba70ae925162cbcea 100644 --- a/src/mapleall/mpl2mpl/src/constantfold.cpp +++ b/src/mapleall/mpl2mpl/src/constantfold.cpp @@ -449,7 +449,7 @@ MIRConst *ConstantFold::FoldIntConstBinaryMIRConst(Opcode opcode, PrimType resul if (useResult64) { result64 = intValueOfConst0 + intValueOfConst1; } else { - result32 = static_cast(static_cast(intValueOfConst0) + static_cast(intValueOfConst1)); + result32 = static_cast(intValueOfConst0) + static_cast(intValueOfConst1); } break; } @@ -457,7 +457,7 @@ MIRConst *ConstantFold::FoldIntConstBinaryMIRConst(Opcode opcode, PrimType resul if (useResult64) { result64 = static_cast(intValueOfConst0 - intValueOfConst1); } else { - result32 = static_cast(static_cast(intValueOfConst0) - static_cast(intValueOfConst1)); + result32 = static_cast(intValueOfConst0) - static_cast(intValueOfConst1); } break; } @@ -465,7 +465,7 @@ MIRConst *ConstantFold::FoldIntConstBinaryMIRConst(Opcode opcode, PrimType resul if (useResult64) { result64 = static_cast(intValueOfConst0 * intValueOfConst1); } else { - result32 = static_cast(static_cast(intValueOfConst0) * static_cast(intValueOfConst1)); + result32 = static_cast(intValueOfConst0) * static_cast(intValueOfConst1); } break; }