Merge pull request #16 from cos/warning-for-ssainstruction-identity

warning on SSAInstruction equals()
This commit is contained in:
Manu Sridharan 2013-04-08 15:15:54 -07:00
commit 80557c6e6d
1 changed files with 6 additions and 0 deletions

View File

@ -252,6 +252,12 @@ public abstract class SSAInstruction {
/**
* We assume these instructions are canonical and managed by a governing IR object. Be careful.
*
* Depending on the caching policy (see {@link com.ibm.wala.ssa.SSACache}), the governing IR may be deleted
* to reclaim memory and recomputed as needed. When an IR is recomputed, it also creates fresh SSAInstruction
* objects that will not equal old ones. Thus, do not compare for identity SSAInstructions obtained from
* distinct calls that retrieve cached values (e.g. distinct CGNode.getIR() calls).
* See <a href="https://github.com/wala/WALA/issues/6"> the github issue </a> for details.
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override