chromatic wrote:
On Friday 07 March 2008 02:22:58 François Perrad wrote:
in r26261 with MinGW32, Lua PMCs seem OK (thank to chromatic).
Several tests fail for me, but it looks like a problem with caller() in Lua,
so it's probably beyond my expertise. It looks simpler to fix (if you know
how the Lua compiler works, hint hint.)
After reverting commit 26097 ([core] Implement does_pmc and ...), I see
a different behavior between trunk and ppd17pmc :
on trunk :
parrot --no-gc lua.pbc -e "print(-nil)"
lua.pbc: EVAL_1:30: attempt to perform arithmetic on a nil value
stack traceback:
EVAL_1:30 in function '&main_10'
languages/lua/lib/luaaux.pir:599 in function 'docall'
lua.pir:353 in function 'dostring'
lua.pir:247 in function 'runargs'
lua.pir:120 in function 'main'
parrot --no-gc lua.pbc -e "print(#nil)"
lua.pbc: EVAL_1:30: attempt to get length of a nil value
stack traceback:
EVAL_1:30 in function '&main_10'
languages/lua/lib/luaaux.pir:599 in function 'docall'
lua.pir:353 in function 'dostring'
lua.pir:247 in function 'runargs'
lua.pir:120 in function 'main'
on ppd17pmc :
parrot --no-gc lua.pbc -e "print(-nil)"
lua.pbc: EVAL_1:30: attempt to perform arithmetic on a nil value
stack traceback:
EVAL_1:30 in function '&main_10'
languages/lua/lib/luaaux.pir:597 in function 'docall'
lua.pir:353 in function 'dostring'
lua.pir:247 in function 'runargs'
lua.pir:120 in function 'main'
parrot --no-gc lua.pbc -e "print(#nil)"
lua.pbc: (unknown file):-1: attempt to get length of a nil value
stack traceback:
(unknown file):-1 in function '&main_10'
EVAL_1:30 in function '&main_10'
languages/lua/lib/luaaux.pir:597 in function 'docall'
lua.pir:353 in function 'dostring'
lua.pir:247 in function 'runargs'
lua.pir:120 in function 'main'
The compiler generates :
- a call to VTABLE_neg (in luaany.pmc) when "print(-nil)"
- a call to METHOD len (in luaany.pmc) when "print(#nil)", # is the
Lua length operator
After that, in ppd17pmc, the method caller (in lua.pmc) find a new level
in the call stack when METHOD len is called.
I don't know if it's a expected behavior in ppd17pmc.
I'll update the test files to accept the output "(unknown file):-1".
François.
-- c