Project

General

Profile

Revision 95944ba1 src/corelang.ml

View differences:

src/corelang.ml
307 307
  | _ -> assert false
308 308

  
309 309
let node_from_name id =
310
  try
311
    Hashtbl.find node_table id
312
  with Not_found -> (Format.eprintf "Unable to find any node named %s@ @?" id;
313
		     assert false)
310
      Hashtbl.find node_table id
311
  (* with Not_found -> (Format.eprintf "Unable to find any node named %s@ @?" id;
312
   *       	     assert false) *)
313

  
314
let update_node id top =
315
  Hashtbl.replace node_table id top
314 316

  
315 317
let is_imported_node td =
316 318
  match td.top_decl_desc with 
......
1221 1223
let reset_cpt_fresh () =
1222 1224
    cpt_fresh := 0
1223 1225
    
1224
let mk_fresh_var node loc ty ck =
1225
  let vars = get_node_vars node in
1226
let mk_fresh_var (parentid, ctx_env) loc ty ck =
1226 1227
  let rec aux () =
1227 1228
  incr cpt_fresh;
1228
  let s = Printf.sprintf "__%s_%d" node.node_id !cpt_fresh in
1229
  if List.exists (fun v -> v.var_id = s) vars then aux () else
1229
  let s = Printf.sprintf "__%s_%d" parentid !cpt_fresh in
1230
  if List.exists (fun v -> v.var_id = s) ctx_env then aux () else
1230 1231
  {
1231 1232
    var_id = s;
1232 1233
    var_orig = false;
......
1234 1235
    var_dec_clock = dummy_clock_dec;
1235 1236
    var_dec_const = false;
1236 1237
    var_dec_value = None;
1237
    var_parent_nodeid = Some node.node_id;
1238
    var_parent_nodeid = Some parentid;
1238 1239
    var_type = ty;
1239 1240
    var_clock = ck;
1240 1241
    var_loc = loc

Also available in: Unified diff