mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 07:17:16 +00:00
Merge pull request #13456 from s-hadinger/berry_fix_setmbr
Berry fix possible memory corruption
This commit is contained in:
commit
41bf1714ff
@ -882,28 +882,34 @@ newframe: /* a new call frame */
|
|||||||
binstance *obj = var_toobj(a);
|
binstance *obj = var_toobj(a);
|
||||||
bstring *attr = var_tostr(b);
|
bstring *attr = var_tostr(b);
|
||||||
if (!be_instance_setmember(vm, obj, attr, c)) {
|
if (!be_instance_setmember(vm, obj, attr, c)) {
|
||||||
|
reg = vm->reg;
|
||||||
vm_error(vm, "attribute_error",
|
vm_error(vm, "attribute_error",
|
||||||
"class '%s' cannot assign to attribute '%s'",
|
"class '%s' cannot assign to attribute '%s'",
|
||||||
str(be_instance_name(obj)), str(attr));
|
str(be_instance_name(obj)), str(attr));
|
||||||
}
|
}
|
||||||
|
reg = vm->reg;
|
||||||
dispatch();
|
dispatch();
|
||||||
}
|
}
|
||||||
if (var_isclass(a) && var_isstr(b)) {
|
if (var_isclass(a) && var_isstr(b)) {
|
||||||
bclass *obj = var_toobj(a);
|
bclass *obj = var_toobj(a);
|
||||||
bstring *attr = var_tostr(b);
|
bstring *attr = var_tostr(b);
|
||||||
if (!be_class_setmember(vm, obj, attr, c)) {
|
if (!be_class_setmember(vm, obj, attr, c)) {
|
||||||
|
reg = vm->reg;
|
||||||
vm_error(vm, "attribute_error",
|
vm_error(vm, "attribute_error",
|
||||||
"class '%s' cannot assign to static attribute '%s'",
|
"class '%s' cannot assign to static attribute '%s'",
|
||||||
str(be_class_name(obj)), str(attr));
|
str(be_class_name(obj)), str(attr));
|
||||||
}
|
}
|
||||||
|
reg = vm->reg;
|
||||||
dispatch();
|
dispatch();
|
||||||
}
|
}
|
||||||
if (var_ismodule(a) && var_isstr(b)) {
|
if (var_ismodule(a) && var_isstr(b)) {
|
||||||
bmodule *obj = var_toobj(a);
|
bmodule *obj = var_toobj(a);
|
||||||
bstring *attr = var_tostr(b);
|
bstring *attr = var_tostr(b);
|
||||||
if (be_module_setmember(vm, obj, attr, c)) {
|
if (be_module_setmember(vm, obj, attr, c)) {
|
||||||
|
reg = vm->reg;
|
||||||
dispatch();
|
dispatch();
|
||||||
} else {
|
} else {
|
||||||
|
reg = vm->reg;
|
||||||
// fall through exception below
|
// fall through exception below
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user