Program: 25727
Project: 25727
Buggy source:
private int doOpcode54_95(int pos,byte[] code,int op){
  TypeData[] localsTypes=this.localsTypes;
  TypeData[] stackTypes=this.stackTypes;
switch (op) {
case Opcode.ISTORE:
    return doXSTORE(pos,code,INTEGER);
case Opcode.LSTORE:
  return doXSTORE(pos,code,LONG);
case Opcode.FSTORE:
return doXSTORE(pos,code,FLOAT);
case Opcode.DSTORE:
return doXSTORE(pos,code,DOUBLE);
case Opcode.ASTORE:
return doASTORE(code[pos + 1] & 0xff);
case Opcode.ISTORE_0:
case Opcode.ISTORE_1:
case Opcode.ISTORE_2:
case Opcode.ISTORE_3:
{
int var=op - Opcode.ISTORE_0;
localsTypes[var]=INTEGER;
stackTop--;
}
break;
case Opcode.LSTORE_0:
case Opcode.LSTORE_1:
case Opcode.LSTORE_2:
case Opcode.LSTORE_3:
{
int var=op - Opcode.LSTORE_0;
localsTypes[var]=LONG;
localsTypes[var + 1]=TOP;
stackTop-=2;
}
break;
case Opcode.FSTORE_0:
case Opcode.FSTORE_1:
case Opcode.FSTORE_2:
case Opcode.FSTORE_3:
{
int var=op - Opcode.FSTORE_0;
localsTypes[var]=FLOAT;
stackTop--;
}
break;
case Opcode.DSTORE_0:
case Opcode.DSTORE_1:
case Opcode.DSTORE_2:
case Opcode.DSTORE_3:
{
int var=op - Opcode.DSTORE_0;
localsTypes[var]=DOUBLE;
localsTypes[var + 1]=TOP;
stackTop-=2;
}
break;
case Opcode.ASTORE_0:
case Opcode.ASTORE_1:
case Opcode.ASTORE_2:
case Opcode.ASTORE_3:
{
int var=op - Opcode.ASTORE_0;
doASTORE(var);
break;
}
case Opcode.IASTORE:
case Opcode.LASTORE:
case Opcode.FASTORE:
case Opcode.DASTORE:
case Opcode.AASTORE:
case Opcode.BASTORE:
case Opcode.CASTORE:
case Opcode.SASTORE:
stackTop-=(op == Opcode.LASTORE || op == Opcode.DASTORE) ? 4 : 3;
break;
case Opcode.POP:
stackTop--;
break;
case Opcode.POP2:
stackTop-=2;
break;
case Opcode.DUP:
{
int sp=stackTop;
stackTypes[sp]=stackTypes[sp - 1];
stackTop=sp + 1;
break;
}
case Opcode.DUP_X1:
case Opcode.DUP_X2:
{
int len=op - Opcode.DUP_X1 + 2;
doDUP_XX(1,len);
int sp=stackTop;
stackTypes[sp - len]=stackTypes[sp];
stackTop=sp + 1;
break;
}
case Opcode.DUP2:
doDUP_XX(2,2);
stackTop+=2;
break;
case Opcode.DUP2_X1:
case Opcode.DUP2_X2:
{
int len=op - Opcode.DUP2_X1 + 3;
doDUP_XX(2,len);
int sp=stackTop;
stackTypes[sp - len]=stackTypes[sp];
stackTypes[sp - len + 1]=stackTypes[sp + 1];
stackTop=sp + 2;
break;
}
case Opcode.SWAP:
{
int sp=stackTop - 1;
TypeData t=stackTypes[sp];
stackTypes[sp]=stackTypes[sp - 1];
stackTypes[sp - 1]=t;
break;
}
default :
throw new RuntimeException("String_Node_Str");
}
return 1;
}

Fixed version (ground truth):
private int doOpcode54_95(int pos,byte[] code,int op) throws BadBytecode {
  TypeData[] localsTypes=this.localsTypes;
  TypeData[] stackTypes=this.stackTypes;
switch (op) {
case Opcode.ISTORE:
    return doXSTORE(pos,code,INTEGER);
case Opcode.LSTORE:
  return doXSTORE(pos,code,LONG);
case Opcode.FSTORE:
return doXSTORE(pos,code,FLOAT);
case Opcode.DSTORE:
return doXSTORE(pos,code,DOUBLE);
case Opcode.ASTORE:
return doASTORE(code[pos + 1] & 0xff);
case Opcode.ISTORE_0:
case Opcode.ISTORE_1:
case Opcode.ISTORE_2:
case Opcode.ISTORE_3:
{
int var=op - Opcode.ISTORE_0;
localsTypes[var]=INTEGER;
stackTop--;
}
break;
case Opcode.LSTORE_0:
case Opcode.LSTORE_1:
case Opcode.LSTORE_2:
case Opcode.LSTORE_3:
{
int var=op - Opcode.LSTORE_0;
localsTypes[var]=LONG;
localsTypes[var + 1]=TOP;
stackTop-=2;
}
break;
case Opcode.FSTORE_0:
case Opcode.FSTORE_1:
case Opcode.FSTORE_2:
case Opcode.FSTORE_3:
{
int var=op - Opcode.FSTORE_0;
localsTypes[var]=FLOAT;
stackTop--;
}
break;
case Opcode.DSTORE_0:
case Opcode.DSTORE_1:
case Opcode.DSTORE_2:
case Opcode.DSTORE_3:
{
int var=op - Opcode.DSTORE_0;
localsTypes[var]=DOUBLE;
localsTypes[var + 1]=TOP;
stackTop-=2;
}
break;
case Opcode.ASTORE_0:
case Opcode.ASTORE_1:
case Opcode.ASTORE_2:
case Opcode.ASTORE_3:
{
int var=op - Opcode.ASTORE_0;
doASTORE(var);
break;
}
case Opcode.IASTORE:
case Opcode.LASTORE:
case Opcode.FASTORE:
case Opcode.DASTORE:
stackTop-=(op == Opcode.LASTORE || op == Opcode.DASTORE) ? 4 : 3;
break;
case Opcode.AASTORE:
TypeData.setType(stackTypes[stackTop - 1],TypeData.ArrayElement.getElementType(stackTypes[stackTop - 3].getName()),classPool);
stackTop-=3;
break;
case Opcode.BASTORE:
case Opcode.CASTORE:
case Opcode.SASTORE:
stackTop-=3;
break;
case Opcode.POP:
stackTop--;
break;
case Opcode.POP2:
stackTop-=2;
break;
case Opcode.DUP:
{
int sp=stackTop;
stackTypes[sp]=stackTypes[sp - 1];
stackTop=sp + 1;
break;
}
case Opcode.DUP_X1:
case Opcode.DUP_X2:
{
int len=op - Opcode.DUP_X1 + 2;
doDUP_XX(1,len);
int sp=stackTop;
stackTypes[sp - len]=stackTypes[sp];
stackTop=sp + 1;
break;
}
case Opcode.DUP2:
doDUP_XX(2,2);
stackTop+=2;
break;
case Opcode.DUP2_X1:
case Opcode.DUP2_X2:
{
int len=op - Opcode.DUP2_X1 + 3;
doDUP_XX(2,len);
int sp=stackTop;
stackTypes[sp - len]=stackTypes[sp];
stackTypes[sp - len + 1]=stackTypes[sp + 1];
stackTop=sp + 2;
break;
}
case Opcode.SWAP:
{
int sp=stackTop - 1;
TypeData t=stackTypes[sp];
stackTypes[sp]=stackTypes[sp - 1];
stackTypes[sp - 1]=t;
break;
}
default :
throw new RuntimeException("String_Node_Str");
}
return 1;
}