Skip to content

bad traphandler assignment(s) - issue #802#803

Closed
swissiety wants to merge 9 commits intodevelopfrom
fix/802_missing_predecessor
Closed

bad traphandler assignment(s) - issue #802#803
swissiety wants to merge 9 commits intodevelopfrom
fix/802_missing_predecessor

Conversation

@swissiety
Copy link
Copy Markdown
Collaborator

@swissiety swissiety commented Jan 8, 2024

    public long run() {
            try {
                return 1;
            } catch (Throwable t) {
                return 2;
            }
    }
  public long run();
    Code:
       0: lconst_1
       1: lreturn
       2: astore_1
       3: ldc2_w        #9                  // long 2l
       6: lreturn

    Exception table:
       from    to  target type
           0     1     2   Class java/lang/Throwable

is currently converted to

$l0 := @this: MissingTrapHandlerAssignment
return 1L
$stack2 := @caughtexception
$l1 = $stack2
return 2L

with a Trap from: return 1L to: return 1L - as the trap only covers lconst_1 op which is erased/inlined/... in the Jimple generation - its then empty as the "to:" part is exclusive and therefore no exception handler is assigned in Jimple -> $stack2 := @caughtexception is not connected.

closes #802

@swissiety swissiety changed the title missing predecessor/traphandler assignment - issue #802 bad traphandler assignment(s) - issue #802 Jan 8, 2024
@swissiety
Copy link
Copy Markdown
Collaborator Author

superseded by #824

@swissiety swissiety closed this Jan 18, 2024
@swissiety swissiety deleted the fix/802_missing_predecessor branch February 1, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A runtime exception bug when SootUp analyzed a class file

1 participant