File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,7 +187,8 @@ struct
187187 let fd = Cilfacade. find_varinfo_fundec f in
188188 match args, fd.sformals with
189189 | [exp], [param] ->
190- let reg = Reg. assign (Analyses. ask_of_ctx ctx) (var param) exp (ctx.global () , RegMap. bot () ) in
190+ (* The parameter may not have escaped here (for the first thread). *)
191+ let reg = Reg. assign ~thread_arg: true (Analyses. ask_of_ctx ctx) (var param) exp (ctx.global () , RegMap. bot () ) in
191192 [`Lifted (snd reg)]
192193 | _ -> [`Lifted (RegMap. bot () )]
193194 let threadspawn ctx lval f args fctx = ctx.local
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ struct
195195 let p = RegPart. add s p in
196196 p, closure p m
197197
198- let assign (ask : Queries.ask ) (lval : lval ) (rval : exp ) (st : t ): t =
198+ let assign ?( thread_arg = false ) (ask : Queries.ask ) (lval : lval ) (rval : exp ) (st : t ): t =
199199 (* let _ = printf "%a = %a\n" (printLval plainCilPrinter) lval (printExp plainCilPrinter) rval in *)
200200 let t = Cilfacade. typeOf rval in
201201 if isPointerType t then begin (* TODO: this currently allows function pointers, e.g. in iowarrior, but should it? *)
@@ -209,7 +209,7 @@ struct
209209 | `Right () -> `Right ()
210210 )
211211 in
212- match BaseUtil. is_global ask (fst x), deref_x, BaseUtil. is_global ask (fst y) with
212+ match BaseUtil. is_global ask (fst x), deref_x, BaseUtil. is_global ask (fst y) || thread_arg with
213213 | false , false , true ->
214214 p, RegMap. add x (append_offs_y (RegPart. closure p (RS. single_vf y))) m
215215 | false , false , false ->
You can’t perform that action at this time.
0 commit comments