|
@@ -142,7 +142,10 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
let read_local v =
|
|
let read_local v =
|
|
try
|
|
try
|
|
Hashtbl.find locals v.v_id
|
|
Hashtbl.find locals v.v_id
|
|
- with Not_found ->
|
|
|
|
|
|
+ with Not_found -> try
|
|
|
|
+ (* if it's in our current local context, it's because we're inlining a local function *)
|
|
|
|
+ let v2 = PMap.find v.v_name ctx.locals in
|
|
|
|
+ if v != v2 then raise Not_found;
|
|
{
|
|
{
|
|
i_var = v;
|
|
i_var = v;
|
|
i_subst = v;
|
|
i_subst = v;
|
|
@@ -151,6 +154,9 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
i_force_temp = false;
|
|
i_force_temp = false;
|
|
i_read = 0;
|
|
i_read = 0;
|
|
}
|
|
}
|
|
|
|
+ with Not_found ->
|
|
|
|
+ (* it's an unbound local, let's clone it *)
|
|
|
|
+ local v
|
|
in
|
|
in
|
|
(* use default values for null/unset arguments *)
|
|
(* use default values for null/unset arguments *)
|
|
let rec loop pl al first =
|
|
let rec loop pl al first =
|