Merge pull request #53142 from RandomShaper/fix_cast_freed_check_3.x

This commit is contained in:
Rémi Verschelde 2021-09-28 07:42:40 +02:00 committed by GitHub
commit 508a616455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -846,7 +846,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
*dst = Variant::construct(to_type, (const Variant **)&src, 1, err);
#ifdef DEBUG_ENABLED
if (src->get_type() == Variant::OBJECT && !src->is_ref() && ObjectDB::get_instance(src->get_object_instance_id()) == nullptr) {
if (src->is_invalid_object()) {
err_text = "Trying to cast a deleted object.";
OPCODE_BREAK;
}
@ -870,7 +870,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
GD_ERR_BREAK(!nc);
#ifdef DEBUG_ENABLED
if (src->get_type() == Variant::OBJECT && !src->is_ref() && ObjectDB::get_instance(src->get_object_instance_id()) == nullptr) {
if (src->is_invalid_object()) {
err_text = "Trying to cast a deleted object.";
OPCODE_BREAK;
}
@ -902,7 +902,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
GD_ERR_BREAK(!base_type);
#ifdef DEBUG_ENABLED
if (src->get_type() == Variant::OBJECT && !src->is_ref() && ObjectDB::get_instance(src->get_object_instance_id()) == nullptr) {
if (src->is_invalid_object()) {
err_text = "Trying to cast a deleted object.";
OPCODE_BREAK;
}