mirror of https://github.com/arendst/Tasmota.git
Merge pull request #15469 from s-hadinger/berry_assertion_bytecode
Berry fix assertion violation when loading bytecode
This commit is contained in:
commit
828ed38762
|
@ -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 */
|
int size = (int)load_long(fp); /* proto count */
|
||||||
if (size) {
|
if (size) {
|
||||||
|
@ -501,7 +501,7 @@ static void load_proto_table(bvm *vm, void *fp, bproto *proto, int version)
|
||||||
proto->ptab = p;
|
proto->ptab = p;
|
||||||
proto->nproto = size;
|
proto->nproto = size;
|
||||||
while (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_bytecode(vm, fp, *proto, info);
|
||||||
load_constant(vm, fp, *proto, version);
|
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);
|
load_upvals(vm, fp, *proto);
|
||||||
return btrue;
|
return btrue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "be_map.h"
|
#include "be_map.h"
|
||||||
#include "be_gc.h"
|
#include "be_gc.h"
|
||||||
#include "be_class.h"
|
#include "be_class.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define global(vm) ((vm)->gbldesc.global)
|
#define global(vm) ((vm)->gbldesc.global)
|
||||||
#define builtin(vm) ((vm)->gbldesc.builtin)
|
#define builtin(vm) ((vm)->gbldesc.builtin)
|
||||||
|
|
Loading…
Reference in New Issue