[Soot-list] Dava fix for switch fall-through
Steffen Pingel
steffenp at gmx.de
Sat Jan 14 19:53:37 EST 2006
Hi,
I have observed a RuntimeException that is caused by a bug in
StructuredAnalysis while trying to decompile Soot [1]. I have attached a
simple example that demonstrats the bug [2]. Here is the stack trace:
Exception in thread "main" java.lang.RuntimeException: Body sent to be
processed by StructuredAnalysis is not a valid body
at
soot.dava.toolkits.base.AST.structuredAnalysis.StructuredAnalysis.process(StructuredAnalysis.java:157)
at
soot.dava.toolkits.base.AST.structuredAnalysis.StructuredAnalysis.processASTSwitchNode(StructuredAnalysis.java:612)
at
soot.dava.toolkits.base.AST.structuredAnalysis.StructuredAnalysis.processASTNode
[...]
The problem is that the loop that iterates over the indicies of an
ASTSwitchNode object does not check if the index is associated with a valid
(non-null) body.
I have attached a simple fix.
Steffen
[1] Soot was compiled and run with Eclipse 3.1.1 using JDK 1.4.2_06
[2] Running "java soot.Main -f d -f d polyglot.types.reflect.ClassFile"
also triggers the bug
--
Steffen Pingel - steffenp at gmx.de - http://steffenpingel.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soot-2260-switch-fall-through.diff
Type: text/x-diff
Size: 828 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060115/78e2929c/soot-2260-switch-fall-through.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Example7.java
Type: text/x-java
Size: 357 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060115/78e2929c/Example7.bin
More information about the Soot-list
mailing list