diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-10-31 00:10:31 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-10-31 00:10:31 +0000 |
| commit | fa0eb88b7ba803dcb0670b4cff771f3584447728 (patch) | |
| tree | 9b239813090a173386a708573d6a93e2bfc0b1a9 /src/main.cpp | |
| parent | 5271adb82f493ea1828051d23ae6854396df1b07 (diff) | |
Interpreter - bounds checking
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index e11207e89..ae0437f93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,19 +166,17 @@ int main(int argc, char **argv) { ssa_gen_tree(&ssa); +#if 1 { VirtualMachine vm = {}; vm_init(&vm, &ssa.module); defer (vm_destroy(&vm)); - String name = make_string("main"); - ssaValue *main_proc_value = *map_get(&vm.module->members, hash_string(name)); - GB_ASSERT(main_proc_value->kind == ssaValue_Proc); - - ssaProcedure *start_proc = &main_proc_value->Proc; + ssaProcedure *start_proc = vm_lookup_procedure(&vm, make_string("main")); Array<vmValue> args = {}; // Empty vm_call_procedure(&vm, start_proc, args); } +#endif { ssaFileBuffer buf = {}; |