vm: modify make_vm to take globals directly instead of constructing an empty global table
This commit is contained in:
+2
-2
@@ -84,8 +84,8 @@ and interpret state =
|
|||||||
interpret state)
|
interpret state)
|
||||||
| NOOP -> interpret state)
|
| NOOP -> interpret state)
|
||||||
|
|
||||||
let make_vm instrs constants global_count =
|
let make_vm instrs constants globals =
|
||||||
let globals = Array.init global_count (fun x -> if x < (Array.length Native.table) then Native x else Nil) in
|
(*let globals = Array.init global_count (fun x -> if x < (Array.length Native.table) then Native x else Nil) in*)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
instrs = instrs;
|
instrs = instrs;
|
||||||
|
|||||||
Reference in New Issue
Block a user