-
Notifications
You must be signed in to change notification settings - Fork 28
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
Generated byte code uses incorrect table object when indexing the result of a function #24
Comments
The issue is caused by IRTranslatorTransformer.popVal() prefering to pop In this example IRTranslatorTransformer.transform(IndexExpr) calls IRTranslatorTransformer.transform(FunctionCallExpr) in line 215 expecting the latter to push a There are two ways to resolve this issue:
|
…n indexing the result of a function (second proposed solution)
Fix mjanicek#24 - Generated byte code uses incorrect table object when indexing the result of a function
…n indexing the result of a function (second proposed solution)
The following Lua code
main.lua
is supposed to print
true
(Confirmed with https://www.lua.org/cgi-bin/demo).Instead it fails with:
It looks like the boolean value and table
t
get swapped when passing them tonet.sandius.rembulan.runtime.Dispatch.setindex(ExecutionContext, Object, Object, Object)
from the generate byte code. With a breakboint inDispatch.setindex
you can clearly see this.Complete example:
The text was updated successfully, but these errors were encountered: