-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Time parsing 32bit corner-case #846
Comments
jaromil
changed the title
Time parsing not fully working
Time parsing 32bit corner-case
Apr 12, 2024
Is this recently fenced off by fixing the js 32bit time conversion? |
Maybe related, found using ASAN
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since time is an integer, it could take values from
-2147483648
to2147483647
, but if I try to dothe following error is returned
While this error is not returned in the case I use
This seems due to some conversion from number to string done internally in lua since, as stated in the documentation, both number and strings are seen as string from
lua_isstring
function (making also the lua_isnumber branching useless)Zenroom/src/zen_time.c
Lines 74 to 121 in ca02f6c
and thus they both pass thorugh the
lua_tostring
function. I tried also to move the branch withlua_isnumber
before thelua_isstring
one, but it seemed that after a certain number, lua was not able to read them correctly.Thus at the moment, if we use numbers in input we are only loosing the time
-2147483648
and using strings in input we should not lose anything. Anyway interesting to notice and maybe look further into it in case any other problems with numbers came up.The text was updated successfully, but these errors were encountered: