From d50676993d6030ffbff9625093c6b969c2b22881 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Mon, 21 Feb 2022 11:25:01 -0800 Subject: [PATCH] Made int64 multiplication tolerant of overflow checking when built debug --- src/mapleall/mpl2mpl/src/constantfold.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapleall/mpl2mpl/src/constantfold.cpp b/src/mapleall/mpl2mpl/src/constantfold.cpp index 555ebfe420..b08fb3a304 100644 --- a/src/mapleall/mpl2mpl/src/constantfold.cpp +++ b/src/mapleall/mpl2mpl/src/constantfold.cpp @@ -1743,7 +1743,7 @@ std::pair ConstantFold::FoldBinary(BinaryNode *node) { result = l; } else if (op == OP_mul && lp.second != 0 && lp.second > -kMaxOffset) { // (X + konst) * rConst -> the pair [(X*rConst), (konst*rConst)] - sum = lp.second * cst; + sum = static_cast(lp.second) * static_cast(cst); if (GetPrimTypeSize(primType) > GetPrimTypeSize(lp.first->GetPrimType())) { lp.first = mirModule->CurFuncCodeMemPool()->New(OP_cvt, primType, PTY_i32, lp.first); } -- Gitee