Skip to content

Commit 81afc79

Browse files
committed
Use set_var in base body
1 parent 8dbb8bc commit 81afc79

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/analyses/base.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,11 +2044,10 @@ struct
20442044
refine ()
20452045

20462046
let body man f =
2047-
(* First we create a variable-initvalue pair for each variable *)
2048-
let init_var v = (AD.of_var v, v.vtype, VD.init_value ~varAttr:v.vattr v.vtype) in
2049-
(* Apply it to all the locals and then assign them all *)
2050-
let inits = List.map init_var f.slocals in
2051-
set_many ~man man.local inits
2047+
let init_var (acc: store) v: store =
2048+
set_var ~man acc v v.vtype (VD.init_value ~varAttr:v.vattr v.vtype)
2049+
in
2050+
List.fold_left init_var man.local f.slocals
20522051

20532052
let return man exp fundec: store =
20542053
if Cil.hasAttribute "noreturn" fundec.svar.vattr then

0 commit comments

Comments
 (0)