Berry fix assertion violation when loading bytecode

This commit is contained in:
Stephan Hadinger 2022-04-26 22:28:41 +02:00
parent e4dce3ddfa
commit 55d66c96d3
2 changed files with 4 additions and 3 deletions

View File

@ -492,7 +492,7 @@ static void load_constant(bvm *vm, void *fp, bproto *proto, int version)
}
}
static void load_proto_table(bvm *vm, void *fp, bproto *proto, int version)
static void load_proto_table(bvm *vm, void *fp, bproto *proto, int info, int version)
{
int size = (int)load_long(fp); /* proto count */
if (size) {
@ -501,7 +501,7 @@ static void load_proto_table(bvm *vm, void *fp, bproto *proto, int version)
proto->ptab = p;
proto->nproto = size;
while (size--) {
load_proto(vm, fp, p++, -1, version);
load_proto(vm, fp, p++, info, version);
}
}
}
@ -538,7 +538,7 @@ static bbool load_proto(bvm *vm, void *fp, bproto **proto, int info, int version
}
load_bytecode(vm, fp, *proto, info);
load_constant(vm, fp, *proto, version);
load_proto_table(vm, fp, *proto, version);
load_proto_table(vm, fp, *proto, info, version);
load_upvals(vm, fp, *proto);
return btrue;
}

View File

@ -12,6 +12,7 @@
#include "be_map.h"
#include "be_gc.h"
#include "be_class.h"
#include <string.h>
#define global(vm) ((vm)->gbldesc.global)
#define builtin(vm) ((vm)->gbldesc.builtin)