You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Fix uninitialized local variables not being reset
This commit is contained in:
@@ -234,6 +234,7 @@ void (*type_init_function_table[])(Variant *) = {
|
||||
&&OPCODE_SET_STATIC_VARIABLE, \
|
||||
&&OPCODE_GET_STATIC_VARIABLE, \
|
||||
&&OPCODE_ASSIGN, \
|
||||
&&OPCODE_ASSIGN_NULL, \
|
||||
&&OPCODE_ASSIGN_TRUE, \
|
||||
&&OPCODE_ASSIGN_FALSE, \
|
||||
&&OPCODE_ASSIGN_TYPED_BUILTIN, \
|
||||
@@ -1256,6 +1257,16 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
||||
}
|
||||
DISPATCH_OPCODE;
|
||||
|
||||
OPCODE(OPCODE_ASSIGN_NULL) {
|
||||
CHECK_SPACE(2);
|
||||
GET_VARIANT_PTR(dst, 0);
|
||||
|
||||
*dst = Variant();
|
||||
|
||||
ip += 2;
|
||||
}
|
||||
DISPATCH_OPCODE;
|
||||
|
||||
OPCODE(OPCODE_ASSIGN_TRUE) {
|
||||
CHECK_SPACE(2);
|
||||
GET_VARIANT_PTR(dst, 0);
|
||||
|
||||
Reference in New Issue
Block a user