IINC treatment corrected
This commit is contained in:
@@ -118,16 +118,7 @@ class EvalInterpreter(private val evalStrategy: EvalStrategy) : Interpreter<Valu
|
|||||||
override fun unaryOperation(insn: AbstractInsnNode, value: Value): Value? {
|
override fun unaryOperation(insn: AbstractInsnNode, value: Value): Value? {
|
||||||
return when (insn.getOpcode()) {
|
return when (insn.getOpcode()) {
|
||||||
INEG -> int(-value.int)
|
INEG -> int(-value.int)
|
||||||
IINC -> {
|
IINC -> int(value.int + (insn as IincInsnNode).incr)
|
||||||
val varIndex = (insn as IincInsnNode).`var`
|
|
||||||
evalStrategy.setLocalVariable(
|
|
||||||
varIndex,
|
|
||||||
int(evalStrategy.getLocalVariable(varIndex).int + insn.incr)
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO: don't know what to do here, returning what we got:
|
|
||||||
value
|
|
||||||
}
|
|
||||||
L2I -> int(value.long.toInt())
|
L2I -> int(value.long.toInt())
|
||||||
F2I -> int(value.float.toInt())
|
F2I -> int(value.float.toInt())
|
||||||
D2I -> int(value.double.toInt())
|
D2I -> int(value.double.toInt())
|
||||||
|
|||||||
Reference in New Issue
Block a user