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

bad error conversion #222

Open
fperrad opened this issue Mar 19, 2021 · 3 comments
Open

bad error conversion #222

fperrad opened this issue Mar 19, 2021 · 3 comments
Labels

Comments

@fperrad
Copy link

fperrad commented Mar 19, 2021

the test suite lua-Harness detects many failures with 1.0-beta4 (and 1.0-beta5).

for example with the conversion string to number.

currently, ravi gives

$ ../../../RAVI/bin/ravi -v -e "print(3 & '7')"
Ravi 5.3.5
Copyright (C) 1994-2019 Lua.org, PUC-Rio
Portions Copyright (C) 2015-2020 Dibyendu Majumdar
Options mirjit
../../../RAVI/bin/ravi: (command line):1: number has no integer representation
stack traceback:
	(command line):1: in main chunk
	[C]: in ?

but 1.0-beta3 behaves like Lua 5.3

$ ../../../LUA/lua-5.3.6/bin/lua -v -e "print(3 & '7')"
Lua 5.3.6  Copyright (C) 1994-2020 Lua.org, PUC-Rio
3

note: with specific compilation (LUA_NOCVTS2N), Lua 5.3 could give

$ ../../../LUA/lua-5.3.6-nocvts2n/bin/lua -v -e "print(3 & '7')"
Lua 5.3.6  Copyright (C) 1994-2020 Lua.org, PUC-Rio
../../../LUA/lua-5.3.6-nocvts2n/bin/lua: (command line):1: attempt to perform bitwise operation on a string value
stack traceback:
	(command line):1: in main chunk
	[C]: in ?

Lua 5.4 throws another kind of error

$ ../../../LUA/lua-5.4.3/bin/lua -v -e "print(3 & '7')"
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio
../../../LUA/lua-5.4.3/bin/lua: (command line):1: attempt to perform bitwise operation on a string value (constant '7')
stack traceback:
	(command line):1: in main chunk
	[C]: in ?

Lua 5.3 (and 5.4) throws the error number has no integer representation only with this kind of code (float -> integer)

$ ../../../LUA/lua-5.3.6/bin/lua -v -e "print(3 & 7.5)"
Lua 5.3.6  Copyright (C) 1994-2020 Lua.org, PUC-Rio
../../../LUA/lua-5.3.6/bin/lua: (command line):1: number has no integer representation
stack traceback:
	(command line):1: in main chunk
	[C]: in ?

beta3 works Lua 5.3,
beta4 tries to follow Lua 5.4, but doesn't succeed.

@fperrad
Copy link
Author

fperrad commented Mar 20, 2021

note: with beta4 & 5, you must toggle nocvts2n in profile_ravi.lua
see https://framagit.org/fperrad/lua-Harness/-/blob/master/test_lua/profile_ravi.lua#L34

@dibyendumajumdar
Copy link
Owner

@fperrad Thank you for the report. I will have a look. Ravi is kind of in-between 5.3 and 5.4 right now - so this is probably the result of that.

@dibyendumajumdar
Copy link
Owner

It seems I had missed a change. However the error is still not 100% same as Lua 5.4

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

No branches or pull requests

2 participants