Skip to content

Commit

Permalink
fix env_captures initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed May 29, 2017
1 parent 6794834 commit cfc4fe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/macro/eval/evalContext.ml
Expand Up @@ -275,7 +275,7 @@ let push_environment_debug ctx info num_locals num_captures =
expr = no_expr;
};
env_locals = Array.make num_locals vnull;
env_captures = Array.make num_captures (ref vnull);
env_captures = Array.init num_captures (fun _ -> ref vnull);
} in
if eval.environment_offset = DynArray.length eval.environments then
DynArray.add eval.environments env
Expand Down Expand Up @@ -311,7 +311,7 @@ let push_environment ctx info num_locals num_captures =
env_in_use = false;
env_debug = no_debug;
env_locals = Array.make num_locals vnull;
env_captures = Array.make num_captures (ref vnull);
env_captures = Array.init num_captures (fun _ -> ref vnull);
}
[@@inline]

Expand Down
2 changes: 1 addition & 1 deletion src/macro/eval/evalJit.ml
Expand Up @@ -262,7 +262,7 @@ and jit_expr jit return e =
jit_closure.capture_infos <- jit.capture_infos;
jit.num_closures <- jit.num_closures + 1;
let exec = jit_tfunction jit_closure true e.epos tf in
let num_captures = Hashtbl.length jit.captures in
let num_captures = Hashtbl.length jit_closure.captures in
let hasret = jit_closure.has_nonfinal_return in
let get_env = get_env jit_closure false (file_hash tf.tf_expr.epos.pfile) (EKLocalFunction jit.num_closures) in
let num_args = List.length tf.tf_args in
Expand Down

0 comments on commit cfc4fe2

Please sign in to comment.