[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua parser question re function calls in local statement
- From: Dibyendu Majumdar <mobile@...>
- Date: Sat, 17 Jan 2015 02:12:18 +0000
Hi,
For following Lua code:
local d, e = f()
The byte-code generated looks like:
1 [1] GETTABUP 0 0 -1 ; _ENV "f"
2 [1] CALL 0 1 3
3 [1] RETURN 0 1
And for following:
local d, e; d, e = f()
We get:
1 [1] LOADNIL 0 1
2 [1] GETTABUP 2 0 -1 ; _ENV "f"
3 [1] CALL 2 1 3
4 [1] MOVE 1 3
5 [1] MOVE 0 2
6 [1] RETURN 0 1
My question is this:
I want to change the code generated for the first case - to capture
the return values from the CALL into temporary registers and then MOVE
them to the locals. I think I need to make changes in localstat()
function in lparser.c but I can't figure out how to do this - would
appreciate any help / tips.
Thanks and Regards
Dibyendu