[Soot-list] DeadAssignmentEliminator and assignments x=null

Patrick Lam plam at sable.mcgill.ca
Tue Sep 11 16:47:41 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric Bodden wrote:
> Today I noticed that the DeadAssignmentEliminator also eliminates
> assignments of the form "x=null;". Such assignments, even if they are
> dead, might however have a purpose: Clearing memory.

I guess that's an unintended side effect of the code. But upon further
reflection, I don't think that this is such a big deal: x=null only gets
eliminated if x is a local variable, not if x is a field (right? if
that's wrong, then my argument would be wrong). All local variables go
out of scope relatively quickly. So I don't think that we'd ever get any
observable effects from eliminating null assignments.

I don't think it's wrong to mark x=null as essential, but I don't think
it's bad to leave it as it is either. I'll leave it up to you.

pat

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG5v7tNTVxnNGEyOgRAmcAAJ9k8h4tWAa6i/NmBlYhtJZ4hXnhhwCeMP7M
vNDo2DGoeLFf/q6D8dTOCKI=
=uCyR
-----END PGP SIGNATURE-----


More information about the Soot-list mailing list