Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-7434 Fix for LaneDivide terminator SUBPIECE trace

caheckmande40b0bf5dc6
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
index 4e9f9a2b5d..1ac039e77e 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
@@ -3969,7 +3969,7 @@ bool LaneDivide::traceForward(TransformVar *rvn,int4 numLanes,int4 skipLanes)
int4 outLanes,outSkip;
if (!description.restriction(numLanes, skipLanes, bytePos, outvn->getSize(), outLanes, outSkip)) {
if (allowSubpieceTerminator) {
- int4 laneIndex = description.getBoundary(bytePos);
+ int4 laneIndex = description.getBoundary(bytePos + description.getPosition(skipLanes));
if (laneIndex < 0 || laneIndex >= description.getNumLanes()) // Does piece start on lane boundary?
return false;
if (description.getSize(laneIndex) <= outvn->getSize()) // Is the piece smaller than a lane?