soot-oss / SootUp

A new version of Soot with a completely overhauled architecture
https://soot-oss.github.io/SootUp/
GNU Lesser General Public License v2.1
564 stars 71 forks source link

[Bug]: TypeAssigner fails if LocalSplitter is not applied beforehand #982

Closed stschott closed 1 month ago

stschott commented 1 month ago

What happened?

When using the TypeAssigner without the LocalSplitter there are some cases where the TypeAssigner assignes BottomType or TopType. Make the TypeAssigner not assign any type in such cases to not break the Jimple.

Version

Latest develop branch

Relevant log output

No response

sahilagichani14 commented 1 month ago

@stschott can you please provide an example of such a case for testing?

sahilagichani14 commented 1 month ago

example where type assigner assigns TopType. void tc15() { try { int a = 8 / 0; int b = a + 2; } catch (ArithmeticException ex) { } } Jimple: void tc15() { TopType a, l2; java.lang.Throwable $stack3; upb.thesis.RQ1.jb_ls.SampleClass this; this := @this: upb.thesis.RQ1.jb_ls.SampleClass; label1: a = 8 / 0; l2 = a + 2; label2: goto label4; label3: $stack3 := @caughtexception; a = $stack3; label4: return; catch java.lang.ArithmeticException from label1 to label2 with label3; }