Skip to content

Commit

Permalink
JacoDB produces incorrect 3-address code for IINC instruction #146
Browse files Browse the repository at this point in the history
  • Loading branch information
lehvolk committed Aug 30, 2023
1 parent 870cebb commit 576f852
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,18 @@ class RawInstListBuilder(
} else {
instructionList(insn).add(inst)
}
when {
insn.isBranchingInst -> postfixInstructions.forEach {
instructionList(insn).add(0, it.value)
}
inst !is JcRawReturnInst -> postfixInstructions.forEach {
instructionList(insn).add(it.value)
if (postfixInstructions.isNotEmpty()) {
when {
insn.isBranchingInst -> postfixInstructions.forEach {
instructionList(insn).add(0, it.value)
}

inst !is JcRawReturnInst -> postfixInstructions.forEach {
instructionList(insn).add(it.value)
}
}
postfixInstructions.clear()
}
postfixInstructions.clear()
}

private fun nextRegister(typeName: TypeName): JcRawValue {
Expand Down

0 comments on commit 576f852

Please sign in to comment.