-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Core: Add recursion level check for Array
and Dictionary
hashing
#80888
[3.x] Core: Add recursion level check for Array
and Dictionary
hashing
#80888
Conversation
return recursive_hash(0); | ||
} | ||
|
||
uint32_t Array::recursive_hash(int p_recursion_count) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me suggest declaring these as (private) uint32_t T::_hash(int p_recursion_count = 0) const
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I just copied it from 4.x though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, if the one in 4.x is already merged, just feel free to ignore me (or make a PR for 4.x if you think my suggestion has enough merit).
Thanks! |
Cherry-picked for 3.5.3. |
Dictionary
as own key crashes Godot #44195.recursive_equal()
and other things are not copied as it would break compatibility.It also prevents crashes in cases like: