Skip to content

Commit

Permalink
fix: move: when deref Arg, the extra args live in from, not argdepth
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Apr 17, 2024
1 parent 8813839 commit 6a16d92
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,16 @@ let rec move ~argsdepth e ?avoid ~from ~to_ t =
| AppUVar ({ contents = t }, vardepth, args) when t != C.dummy ->
if depth == 0 then deref_appuv ?avoid ~from:vardepth ~to_ args t
else maux empty_env depth (deref_appuv ~from:vardepth ~to_:(from+depth) args t)
| Arg (i, args) when e.(i) != C.dummy ->
deref_uv ?avoid ~from:argsdepth ~to_:(to_+depth) args e.(i)
| Arg (i, argsno) when e.(i) != C.dummy ->
if from = argsdepth then deref_uv ?avoid ~from:argsdepth ~to_:(to_+depth) argsno e.(i)
else
let args = C.mkinterval from argsno 0 in
let args =
try smart_map3 maux e depth args
with RestrictionFailure ->
anomaly "move: could check if unrestrictable args are unused" in
deref_appuv ?avoid ~from:argsdepth ~to_:(to_+depth) args e.(i)

| AppArg(i, args) when e.(i) != C.dummy ->
let args =
try smart_map3 maux e depth args
Expand Down

0 comments on commit 6a16d92

Please sign in to comment.