[Soot-list] removing singletons
Eric Bodden
eric.bodden at ec-spride.de
Fri Jul 13 08:01:00 EDT 2012
Hi Phil.
Thanks for the effort, but I don't quite see how that would help. The
problem is that when you remove a singleton then you need to inject it
into the code as a dependency, which means updating many signatures.
That's all doable but it is a very nontrivial change. I don't see how
Strings would help here.
Eric
On 13 July 2012 13:43, Phil Pratt-Szeliga <pcpratts at syr.edu> wrote:
> Hello,
>
> There was talk about removing the singletons in soot. One idea that
> would maybe help this would be to use more string comparisons rather
> than object comparisons.
>
> Some code that I am looking at right now for a patch I am writing
> looks like this:
>
> List<Local> uniqueLocals = new ArrayList<Local>();
> Iterator<DefinitionStmt> it = allDefs.iterator();
> while(it.hasNext()){
> DefinitionStmt s = it.next();
> Value left = s.getLeftOp();
> if(left instanceof Local){
> if(uniqueLocals.contains(left)){
> uniqueLocals.remove(left);
> }
> }|
> }
>
> It would be converted to:
>
> List<String> uniqueLocals = new ArrayList<String>();
> Iterator<DefinitionStmt> it = allDefs.iterator();
> while(it.hasNext()){
> DefinitionStmt s = it.next();
> Value left = s.getLeftOp();
> if(left instanceof Local){
> if(uniqueLocals.contains(left.toString())){
> uniqueLocals.remove(left.toString());
> //or maybe use the local name here
> }
> }|
> }
>
>
> Just a thought.
>
> Phil Pratt-Szeliga
> Syracuse University
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
--
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
More information about the Soot-list
mailing list