Skip to content

Commit ab91237

Browse files
committed
Handle pthread arg in region analysis
1 parent 90b9e56 commit ab91237

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/analyses/region.ml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,13 @@ struct
180180
let startstate v =
181181
`Lifted (RegMap.bot ())
182182

183-
let threadenter ctx lval f args =
184-
[`Lifted (RegMap.bot ())]
183+
let threadenter ctx lval f args: D.t list =
184+
let fd = Cilfacade.find_varinfo_fundec f in
185+
match args, fd.sformals with
186+
| [exp], [param] ->
187+
let reg = Reg.assign (var param) exp (ctx.global (), RegMap.bot ()) in
188+
[`Lifted (snd reg)]
189+
| _ -> [`Lifted (RegMap.bot ())]
185190
let threadspawn ctx lval f args fctx = ctx.local
186191

187192
let exitstate v = `Lifted (RegMap.bot ())

0 commit comments

Comments
 (0)