1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 23:23:07 +00:00

Work on deserialization for loading bytecode and

other objects.
This commit is contained in:
Calvin Rose
2017-03-19 12:16:40 -04:00
parent 9856142fef
commit a2f3fa3b3d
6 changed files with 400 additions and 81 deletions

View File

@@ -221,10 +221,10 @@ static int gst_continue_size(Gst *vm, uint32_t stackBase) {
if (pc[2] > v1.data.function->def->literalsLen)
gst_error(vm, GST_NO_UPVALUE);
temp = v1.data.function->def->literals[pc[2]];
if (temp.type != GST_NIL)
if (temp.type != GST_FUNCDEF)
gst_error(vm, "cannot create closure");
fn = gst_alloc(vm, sizeof(GstFunction));
fn->def = (GstFuncDef *) temp.data.pointer;
fn->def = temp.data.def;
fn->parent = v1.data.function;
fn->env = gst_frame_env(stack);
temp.type = GST_FUNCTION;
@@ -394,6 +394,7 @@ static int gst_continue_size(Gst *vm, uint32_t stackBase) {
pc = temp.data.function->def->byteCode;
} else {
int status;
gst_frame_pc(stack) = pc;
GST_STATE_WRITE();
vm->ret.type = GST_NIL;
status = temp.data.cfunction(vm);