soot-oss / soot

Soot - A Java optimization framework
GNU Lesser General Public License v2.1
2.85k stars 706 forks source link

In the case of two nested IF statements, the IfStmt returns the wrong lineNumber #2017

Open chumobyte opened 10 months ago

chumobyte commented 10 months ago

Describe the bug In the case of nested IF expressions, the outer second IF expression fetches the wrong lineNumber, mistakenly taking the lineNumber of the first IF.

Input file sootbug.zip

To reproduce Steps to reproduce the behavior:

  1. Attached is a complete Java Maven project demonstrating the bug (it can only run in a Java 8 environment). Open it using IntelliJ IDEA and run it directly to demonstrate the issue I want to convey.
  2. After running the project, the following information will be printed:
    line:[9]      if i0 < 90 goto (branch)
    line:[11]      if $z0 != 0 goto r9 = "mute"
    line:[9]      if i0 < 80 goto (branch)
    line:[19]      if i0 < 70 goto return

Expected behavior I expect the expression if (score >= 80) to correctly display lineNumber 17.

Stacktrace

Additional context Thank you very much