pascal-lab / Tai-e-assignments

Tai-e assignments for static program analysis
https://tai-e.pascal-lab.net/
GNU Lesser General Public License v3.0
1.01k stars 234 forks source link

a doubt about hashCode of Value #18

Open hahacyd opened 11 months ago

hahacyd commented 11 months ago

current implementation of Value's hashCode is: public int hashCode() { return value; } but this will result in Value.makeConstant(0).hashCode() equals Value.getNAC().hashCode() and Value.getUndef().hashCode()

and thus a hashCode of CPFact's instance may not changed when a Value changed.

an optional implementation public int hashCode() { return toString().hashCode(); }