mirror of https://github.com/arendst/Tasmota.git
Berry prevent crash when setting superclass of solidified class
This commit is contained in:
parent
aab4dcdb6a
commit
a147e00f6d
|
@ -984,7 +984,12 @@ newframe: /* a new call frame */
|
|||
bvalue *a = RA(), *b = RKB();
|
||||
if (var_isclass(a) && var_isclass(b)) {
|
||||
bclass *obj = var_toobj(a);
|
||||
be_class_setsuper(obj, var_toobj(b));
|
||||
if (!gc_isconst(obj)) {
|
||||
be_class_setsuper(obj, var_toobj(b));
|
||||
} else {
|
||||
vm_error(vm, "internal_error",
|
||||
"cannot change superclass of a read-only class");
|
||||
}
|
||||
} else {
|
||||
vm_error(vm, "type_error",
|
||||
"value '%s' does not support set super",
|
||||
|
|
Loading…
Reference in New Issue