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

Discrepancy of OP_RAVI_TOSTRING between VM and JIT #225

Open
XmiliaH opened this issue May 20, 2021 · 5 comments
Open

Discrepancy of OP_RAVI_TOSTRING between VM and JIT #225

XmiliaH opened this issue May 20, 2021 · 5 comments

Comments

@XmiliaH
Copy link
Contributor

XmiliaH commented May 20, 2021

As noted in #223 (comment) there is a discrepancy between the VM and JIT for the OP_RAVI_TOSTRING. The VM allows nil, however, the JIT doesn't.
Following code produces an error after the function is compiled:

function test(s: string)
    return s
end

print(test(nil))

ravi.compile(test)

print(test(nil))
@XmiliaH XmiliaH changed the title Discrepancy of OP_RAVI_TOSTRING between VM and JIT. Discrepancy of OP_RAVI_TOSTRING between VM and JIT May 20, 2021
@XmiliaH
Copy link
Contributor Author

XmiliaH commented May 20, 2021

The same behavior can be seen for closure.

@snoopcatt
Copy link

Yay, really.

It turns out that we don't have to break backwards compatibility with proposed change.
Because it's already broken (between JIT and VM) 🚬

@dibyendumajumdar
Copy link
Owner

Sorry my bad. I think my original LLVM backend matched the interpreter semantics.

@dibyendumajumdar
Copy link
Owner

For now I pushed some changes to improve consistency between JIT & VM.

@dibyendumajumdar
Copy link
Owner

Hi @XmiliaH if you are able to check that the behavior is consistent now please let me know.

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

3 participants