You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a87d53b added nan/inf protection to luaL_checknumber and lua_tofloat.
what about lua_tonumber? It also produces floats and seems to be used a lot but didn't get protection.
should functions that produce an int also get protection? In Lua, the number type is a float and the engine does a cast when it wants an int. Isn't this UB if the float was nan/inf? Can it be UB or implementation defined if the float was outside int bounds? This one is less about crashes (since all ints are "valid") and more about desync. I assume it's handled by all of our usual SSE/streflop/etc magic that prevents all the other ways floats could desync but perhaps it's worth checking either way.
The text was updated successfully, but these errors were encountered:
a87d53b added nan/inf protection to
luaL_checknumber
andlua_tofloat
.lua_tonumber
? It also produces floats and seems to be used a lot but didn't get protection.number
type is a float and the engine does a cast when it wants an int. Isn't this UB if the float was nan/inf? Can it be UB or implementation defined if the float was outside int bounds? This one is less about crashes (since all ints are "valid") and more about desync. I assume it's handled by all of our usual SSE/streflop/etc magic that prevents all the other ways floats could desync but perhaps it's worth checking either way.The text was updated successfully, but these errors were encountered: