mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
GDScript: Properly validate return type
When the type cannot be validated at compile time, the runtime must do a check to ensure type safety is kept, as the code might be assuming the return type is correct in another place, leading to crashes if the contract is broken.
This commit is contained in:
parent
655a913e22
commit
35682d3079
4 changed files with 304 additions and 6 deletions
|
@ -306,6 +306,10 @@ public:
|
|||
OPCODE_JUMP_IF_NOT,
|
||||
OPCODE_JUMP_TO_DEF_ARGUMENT,
|
||||
OPCODE_RETURN,
|
||||
OPCODE_RETURN_TYPED_BUILTIN,
|
||||
OPCODE_RETURN_TYPED_ARRAY,
|
||||
OPCODE_RETURN_TYPED_NATIVE,
|
||||
OPCODE_RETURN_TYPED_SCRIPT,
|
||||
OPCODE_ITERATE_BEGIN,
|
||||
OPCODE_ITERATE_BEGIN_INT,
|
||||
OPCODE_ITERATE_BEGIN_FLOAT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue