From 7895bec958022b2fc81ee3fa989989ff3a296495 Mon Sep 17 00:00:00 2001 From: Brice Dobry Date: Thu, 12 Aug 2021 13:07:24 -0400 Subject: [PATCH] Resolve bad memory access discovered by valgrind This loop was accessing 1 element beyond the end of the vector. --- src/mapleall/maple_me/src/irmap_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapleall/maple_me/src/irmap_build.cpp b/src/mapleall/maple_me/src/irmap_build.cpp index b0f5ff72e5..ed07002774 100644 --- a/src/mapleall/maple_me/src/irmap_build.cpp +++ b/src/mapleall/maple_me/src/irmap_build.cpp @@ -902,7 +902,7 @@ void IRMapBuild::BuildBB(BB &bb, std::vector &bbIRMapProcessed) { BuildBB(*irMap->GetBB(childBBId), bbIRMapProcessed); } if (propagater) { - for (uint32 i = 1; i < propagater->GetVstLiveStackVecSize(); i++) { + for (uint32 i = 1; i < curStackSizeVec.size(); i++) { MapleStack *liveStack = propagater->GetVstLiveStackVec(i); uint32 curSize = curStackSizeVec[i]; while (liveStack->size() > curSize) { -- Gitee