From 196f7cb153368bc855606665fc1e97d82c31e91e Mon Sep 17 00:00:00 2001 From: Julian Dolby Date: Thu, 31 May 2018 19:32:02 -0400 Subject: [PATCH] fix for nasty bug in decoding dup2_x2 --- com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/Decoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/Decoder.java b/com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/Decoder.java index 01eea0472..427457b32 100644 --- a/com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/Decoder.java +++ b/com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/Decoder.java @@ -513,10 +513,11 @@ public abstract class Decoder implements Constants { case OP_dup2_x1: i = DupInstruction.make(elemCount(stackWords, stackLen - 1), 1); break; - case OP_dup2_x2: - i = DupInstruction.make(elemCount(stackWords, stackLen - 1), elemCount(stackWords, stackLen - 2)); + case OP_dup2_x2: { + int twoDown = elemCount(stackWords, stackLen - 1); + i = DupInstruction.make(twoDown, elemCount(stackWords, stackLen - twoDown - 1)); break; - case OP_iinc: { + } case OP_iinc: { int v = wide ? decodeUShort(index) : (code[index] & 0xFF); int c = wide ? decodeShort(index + 2) : code[index + 1];