GDScript: Fix temp values being written without proper clear
Temporary values in the stack were not being properly cleared when the return value of calls were discarded, which can cause memory issues especially for reference types like PackedByteArray.
This commit is contained in:
parent
2ac2db8de5
commit
66fda2aeea
4 changed files with 61 additions and 61 deletions
|
|
@ -0,0 +1,17 @@
|
|||
# https://github.com/godotengine/godot/issues/71177
|
||||
|
||||
func test():
|
||||
builtin_method()
|
||||
builtin_method_static()
|
||||
print("done")
|
||||
|
||||
func builtin_method():
|
||||
var pba := PackedByteArray()
|
||||
@warning_ignore(return_value_discarded)
|
||||
pba.resize(1) # Built-in validated.
|
||||
|
||||
|
||||
func builtin_method_static():
|
||||
var _pba := PackedByteArray()
|
||||
@warning_ignore(return_value_discarded)
|
||||
Vector2.from_angle(PI) # Static built-in validated.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_OK
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue