[Soot-list] Found a bug in soot.toolkits.graph.HashMutableEdgeLabelledDirectedGraph
Marc-André Laverdière
marc-andre.laverdiere-papineau at polymtl.ca
Mon Feb 10 11:33:04 EST 2014
Hello Utsav,
Are you using the latest code from the develop branch or 2.5.0?
If you can confirm the bug with the latest code, please file a report
with the test cases on github.
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate
On 02/10/2014 05:50 AM, Utsav Chokshi wrote:
> Hello soot-community,
> According to my observation there is a BUG in following methods of
> HashMutableEdgeLabelledDirectedGraph :
> 1) ContainsAnyEdge(Object from, Object to)
> 2) ContainsAnyEdge(Object Label)
>
> TestCase (for 1) : Calling method for nodes for which no edge is added
> between them.
>
> In that case , edgesToLabels.get(edge) returns null and so method
> returns true.
> That is obviously incorrect.
>
> TestCase ( for 2) : Calling method for label that does not exist in graph.
>
> Same consequences happen as above test case.
>
> Solution 1:
>
> ContainsAnyEdge(Object from, Object to){
>
> DGEdge edge= new DGEdge(from, to);
> if( edgeToLabels.get(edge) == null || edgesToLabels.get(edge).isEmpty()){
> return false;
> }
> return true;
> }
>
> Solution 2:
> Same as above .
> Just substitute hashmap edgesToLabels by labelsToEdges.
>
> - Utsav Chokshi
> [ Currently developing Java Slicer using SOOT framework]
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
More information about the Soot-list
mailing list