Skip to content
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

Error when process the jit/dump.lua in luajit. #4

Open
watsonsong opened this issue Jul 9, 2018 · 0 comments
Open

Error when process the jit/dump.lua in luajit. #4

watsonsong opened this issue Jul 9, 2018 · 0 comments

Comments

@watsonsong
Copy link
Contributor

watsonsong commented Jul 9, 2018

The luasrcdiet report error when I use it to process the dump.lua file, with this error:

lua.exe: .\luasrcdiet\llex.lua:93: [string]:323: malformed number

The command line I use is:
bin/luasrcdiet --maximum %sourceFile% -o %output%

The lua dump file is from:
https://github.com/LuaJIT/LuaJIT/blob/master/src/jit/dump.lua

It seems the error occur when process the following code:
s = format(0 < k and k < 0x1p-1026 and "%+a" or "%+.14g", k)

the 0x1p-1026 is not parse correctly, blew the code:
local v = sub(z, p, q) -- string equivalent if not tonumber(v) then -- handles hex test also errorline("malformed number") end
The v send to tonumber is 0x1p, but not '0x1p-1026', which make this error happen. The regex can not handle the '0x' prefix and ‘p’ character.

BTW, the tonumber() in normal lua can not process this type of number, but the luajit do. I think this tool could consider support the luajit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant