diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index d6817f1ebd0885c8a1373316be062fae44efab90..28ced05760cc6c930c7f7056b98ffb517dab1e45 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index 8acee954172a3503a09325b998830fef01730401..50a27fd5f3e098b292bff19f6199b201cfe691b3 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/maple_ipa/src/callgraph.cpp b/src/maple_ipa/src/callgraph.cpp index 571b6e864f5346a1f19fff11227e5564396e67d0..d191d61d42bb4d2b9e0cb9fdddbfcff24c9f5dfa 100644 --- a/src/maple_ipa/src/callgraph.cpp +++ b/src/maple_ipa/src/callgraph.cpp @@ -1263,9 +1263,12 @@ void CallGraph::GenCallGraph() { } // Deal with function override, function in current module override functions from mplt. // Don't need anymore as we rebuild candidate base on the latest CHA. - for (auto it = GlobalTables::GetFunctionTable().GetFuncTable().begin(); - it != GlobalTables::GetFunctionTable().GetFuncTable().end(); it++) { - MIRFunction *mirFunc = *it; + std::vector &funcTable = GlobalTables::GetFunctionTable().GetFuncTable(); + // don't optimize this loop to iterator or range-base loop + // because AddCallGraphNode(mirFunc) will change GlobalTables::GetFunctionTable().GetFuncTable() + // see: https://gitlab.huawei.com/Maple/ArkKit/issues/122 + for (size_t index = 0; index < funcTable.size(); index++) { + MIRFunction *mirFunc = funcTable.at(index); if (mirFunc == nullptr || mirFunc->GetBody() == nullptr) { continue; } diff --git a/src/maple_ir/include/mir_const.h b/src/maple_ir/include/mir_const.h index af0a8d6a434b16e5088d5946f9341ec31db9e2fd..d6979654b0f6666a1e3be6002bd773a2d5ab2251 100644 --- a/src/maple_ir/include/mir_const.h +++ b/src/maple_ir/include/mir_const.h @@ -138,16 +138,19 @@ class MIRIntConst : public MIRConst { void SetValue(int64 val) { CHECK_FATAL(false, "Can't Use This Interface in This Object"); + (void)val; } void SetFieldID(uint32 fieldIdx) override { CHECK_FATAL(false, "Can't Use This Interface in This Object"); + (void)fieldIdx; } bool operator==(const MIRConst &rhs) const override; MIRIntConst *Clone(MemPool &memPool) const override { CHECK_FATAL(false, "Can't Use This Interface in This Object"); + (void)memPool; return nullptr; }