X Tutup
Skip to content

Core: Support INF/NAN in JSON from/to native#111522

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Repiteo:core/to-from-native
Oct 29, 2025
Merged

Core: Support INF/NAN in JSON from/to native#111522
Repiteo merged 1 commit intogodotengine:masterfrom
Repiteo:core/to-from-native

Conversation

@Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Oct 11, 2025

In the interest of minimality, this integrates a fix as a hardcoded override for the to_native() function. An alternative implementation would be expanding built_in_strtod to recognize INF/NAN, which would be MUCH faster but risks subtle bugs basically everywhere

@Repiteo Repiteo added this to the 4.6 milestone Oct 11, 2025
@Repiteo Repiteo added the bug label Oct 11, 2025
@Repiteo Repiteo requested a review from a team as a code owner October 11, 2025 19:51
@Repiteo Repiteo requested a review from a team as a code owner October 11, 2025 19:51
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test but this looks good!

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested, but the code looks good to me. And, since this is our JSON serialization for Godot native types, I think this should be fine to do, since this our custom format anyway

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in the last core meeting. This is a fix for bug in a supported feature that just wasn't considered in the original implementation.

@Repiteo Repiteo merged commit 8810580 into godotengine:master Oct 29, 2025
20 checks passed
@Repiteo Repiteo deleted the core/to-from-native branch October 29, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON from/to native functions don't work with Infinity or NaN values

4 participants

X Tutup