<div dir="ltr">Hi,<div><br></div><div>I am trying to get hold of all the basic blocks in the body of the function and identifying if they correspond to a cat block or not.</div><div><br></div><div>Whenever my test file has an explicit throw statement, the following line in my CustomSceneAnalysis fails :</div><div><br></div><div>BlockGraph bg = new ExceptionalBlockGraph(b); </div><div><br></div><div>where Body b = m.getActiveBody(); is executed somewhere before that. </div><div><br></div><div>The stack trace is :</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">java.lang.IllegalStateException: UnitThrowAnalysis StmtSwitch: type of throw argument is not a RefType!</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.exceptions.AbstractThrowAnalysis.mightThrowExplicitly(AbstractThrowAnalysis.java:65)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseThrowStmt(UnitThrowAnalysis.java:706)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.jimple.internal.JThrowStmt.apply(JThrowStmt.java:70)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:241)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalUnitGraph$1.getThrowables(ExceptionalUnitGraph.java:807)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalBlockGraph.collectDests(ExceptionalBlockGraph.java:259)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalBlockGraph.buildExceptionDests(ExceptionalBlockGraph.java:217)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalBlockGraph.buildBlocks(ExceptionalBlockGraph.java:183)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.BlockGraph.<init>(BlockGraph.java:69)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalBlockGraph.<init>(ExceptionalBlockGraph.java:106)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.toolkits.graph.ExceptionalBlockGraph.<init>(ExceptionalBlockGraph.java:93)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at myCustomAnalysis$mySceneTransformer.internalTransform(myCustomAnalysis.java:65)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.SceneTransformer.transform(SceneTransformer.java:39)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.Transform.apply(Transform.java:90)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.ScenePack.internalApply(ScenePack.java:40)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.Pack.apply(Pack.java:121)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.PackManager.runWholeProgramPacks(PackManager.java:565)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.PackManager.runPacksNormally(PackManager.java:457)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.PackManager.runPacks(PackManager.java:392)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.Main.run(Main.java:271)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at soot.Main.main(Main.java:147)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span>at myCustomAnalysis.main(myCustomAnalysis.java:23)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></p></div><div><br></div><div>Any pointers to why this is happening or how to avoid it will be helpful.</div><div><br></div><div>Thanks,</div><div>Samanwita</div><div><br></div></div>