Identical lvals not equal in Cil_datatype.Lval.Hashtbl
ID0001263: This issue was created automatically from Mantis Issue 1263. Further discussion may take place here.
Id | Project | Category | View | Due Date | Updated |
---|---|---|---|---|---|
ID0001263 | Frama-C | Kernel | public | 2012-08-08 | 2012-09-19 |
Reporter | boris | Assigned To | virgile | Resolution | fixed |
Priority | low | Severity | feature | Reproducibility | always |
Platform | - | OS | - | OS Version | - |
Product Version | Frama-C Nitrogen-20111001 | Target Version | - | Fixed in Version | Frama-C Oxygen-20120901 |
Description :
The code below contains an lval this->gear at positions 1,2. If this->gear is hashed at position 1 using Cil_datatype.Lval.Hashtbl, a find for this->gear fails at position 2.
if(inp == up) { if(this->gear < MAX_GEARS && motor_rpm(this, this->gear + 1) >= RPM_MIN) this->gear++; // 1 } else if(inp == down) { if(this->gear > 1 && motor_rpm(this, this->gear + 1) <= RPM_MAX) this->gear--; // 2 }
The problem disappears if the lvals are converted to terms with
let xtl = Logic_utils.lval_to_term_lval false x in Logic_const.term (TLval xtl) (Cil.typeOfTermLval xtl)
and hashed with
module TermHT = Hashtbl.Make(struct type t = Cil_types.term let equal = Logic_utils.is_same_term let hash = Logic_utils.hash_term end)