[Soot-list] Condition Statement in JimpleBody
wanzhiyuan at zju.edu.cn
wanzhiyuan at zju.edu.cn
Tue May 14 22:57:19 EDT 2013
Hi there.
I have encounted a problem with JimpleBody when analyzing applications using Soot.
The source code snippet is as following:
private boolean valnum(final Node node, final HashMap table) {
...
1 Tuple tuple = (Tuple) tuples.get(node);
2 if (tuple == null) {
3 // Make a new Tuple for the node being processed
4 final Node s = simplify(node);
5 tuple = new Tuple(s);
6 tuples.put(node, tuple);
...
}
The corresponding JimpleBody is as following:
1 $r9 = virtualinvoke $r8.<java.util.HashMap: java.lang.Object get(java.lang.Object)>(r1);
2 r3 = (EDU.purdue.cs.bloat.trans.ValueNumbering$Tuple) $r9;
3 if r3 != null goto label2;
4 r4 = specialinvoke r0.<EDU.purdue.cs.bloat.trans.ValueNumbering: EDU.purdue.cs.bloat.tree.Node simplify(EDU.purdue.cs.bloat.tree.Node)>(r1);
5 $r10 = new EDU.purdue.cs.bloat.trans.ValueNumbering$Tuple;
6 specialinvoke $r10.<EDU.purdue.cs.bloat.trans.ValueNumbering$Tuple: void <init>(EDU.purdue.cs.bloat.trans.ValueNumbering,EDU.purdue.cs.bloat.tree.Node)>(r0, r4);
7 r11 = $r10;
8 $r12 = r0.<EDU.purdue.cs.bloat.trans.ValueNumbering: java.util.HashMap tuples>;
9 virtualinvoke $r12.<java.util.HashMap: java.lang.Object put(java.lang.Object,java.lang.Object)>(r1, r3);
In the source, local "tuple" is passed to method HashMap.put() at the call site in Line 6. And I find local "tuple" in source is corresponding to both "r3" and "r11" in JimpleBody, right? So I expect both of them will passed as augument to corresponding call site in JimpleBody.
However, I can find only one corresponding call site in JimpleBody (at Line 9). "r11" has been missed to pass as argument.
I guess this is due to the condition statement "if (tuple == null) ".
For I intend to analyze all the auguments passing to method call, the issue above will cause unsoundness.
Are there any solutions for this issue?
Thanks and all the best
Zhiyuan Wan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130515/dd43e9a0/attachment.html
More information about the Soot-list
mailing list