summaryrefslogtreecommitdiff
path: root/src/jib/c_backend.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2020-07-15 13:27:35 +0100
committerGitHub2020-07-15 13:27:35 +0100
commitd7a77f7e13dfcf5c8ef607dbabef801141ffacaa (patch)
tree02bb7ca494ace110617aa2665a953f609646cf24 /src/jib/c_backend.ml
parent71694474c5d59f61fb6b96ac396d30c6c43a2c73 (diff)
parent3bf8126178f7d3aca41686b3759cf35e9284a06c (diff)
Merge pull request #77 from julienfreche/fix_name_instead_of_global_c2
c2: primop: -O: make sure to pick global or name correctly
Diffstat (limited to 'src/jib/c_backend.ml')
-rw-r--r--src/jib/c_backend.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml
index 9dedb830..b2447125 100644
--- a/src/jib/c_backend.ml
+++ b/src/jib/c_backend.ml
@@ -320,21 +320,21 @@ module C_config(Opts : sig val branch_coverage : out_channel option end) : Confi
(* We need to check that id's type hasn't changed due to flow typing *)
let _, ctyp' = Bindings.find id ctx.locals in
if ctyp_equal ctyp ctyp' then
- AV_cval (V_id (name id, ctyp), typ)
+ AV_cval (V_id (name_or_global ctx id, ctyp), typ)
else
(* id's type changed due to flow typing, so it's
really still heap allocated! *)
v
with
(* Hack: Assuming global letbindings don't change from flow typing... *)
- Not_found -> AV_cval (V_id (name id, ctyp), typ)
+ Not_found -> AV_cval (V_id (name_or_global ctx id, ctyp), typ)
end
else
v
| Register (_, _, typ) ->
let ctyp = convert_typ ctx typ in
if is_stack_ctyp ctyp && not (never_optimize ctyp) then
- AV_cval (V_id (name id, ctyp), typ)
+ AV_cval (V_id (global id, ctyp), typ)
else
v
| _ -> v