File tree Expand file tree Collapse file tree
jacodb-core/src/main/kotlin/org/jacodb/impl/cfg Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,11 +253,13 @@ class MethodNodeBuilder(
253253 var shouldReverse = false
254254 val (zeroValue, zeroCmpOpcode, defaultOpcode) = when (cond) {
255255 is JcRawEqExpr -> when {
256+ cond.lhv.typeName == PredefinedPrimitives .Null .typeName() -> Triple (JcRawNull (), Opcodes .IFNULL , Opcodes .IF_ACMPEQ )
256257 cond.lhv.typeName.isPrimitive -> Triple (JcRawInt (0 ), Opcodes .IFEQ , Opcodes .IF_ICMPEQ )
257258 else -> Triple (JcRawNull (), Opcodes .IFNULL , Opcodes .IF_ACMPEQ )
258259 }
259260
260261 is JcRawNeqExpr -> when {
262+ cond.lhv.typeName == PredefinedPrimitives .Null .typeName() -> Triple (JcRawNull (), Opcodes .IFNONNULL , Opcodes .IF_ACMPNE )
261263 cond.lhv.typeName.isPrimitive -> Triple (JcRawInt (0 ), Opcodes .IFNE , Opcodes .IF_ICMPNE )
262264 else -> Triple (JcRawNull (), Opcodes .IFNONNULL , Opcodes .IF_ACMPNE )
263265 }
Original file line number Diff line number Diff line change @@ -211,27 +211,6 @@ class RawInstListBuilder(
211211 return Simplifier ().simplify(method.enclosingClass.classpath, localsNormalizedInstructionList)
212212 }
213213
214- fun insnToString (insn : AbstractInsnNode ): String {
215- insn.accept(mp)
216- val sw = StringWriter ()
217- printer.print (PrintWriter (sw))
218- printer.getText().clear()
219- return sw.toString()
220- }
221-
222- private val printer: Printer = Textifier ()
223- private val mp = TraceMethodVisitor (printer)
224-
225- fun printMethod (methodNode : MethodNode ): String {
226- val inList = methodNode.instructions;
227- var s = " "
228- s + = methodNode.name + " \n "
229- for (i in 0 until methodNode.instructions.size()) {
230- s + = insnToString(inList.get(i))
231- }
232- return s
233- }
234-
235214 private fun buildInstructions () {
236215 currentFrame = createInitialFrame()
237216 frames[ENTRY ] = currentFrame
@@ -1084,6 +1063,11 @@ class RawInstListBuilder(
10841063
10851064 push(throwable)
10861065 }
1066+ var curNode: AbstractInsnNode = insnNode
1067+ while (curNode !is LabelNode ) {
1068+ curNode = curNode.previous
1069+ frames[curNode] = currentFrame
1070+ }
10871071 }
10881072
10891073 private fun buildIincInsnNode (insnNode : IincInsnNode ) {
You can’t perform that action at this time.
0 commit comments