You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user