-
Notifications
You must be signed in to change notification settings - Fork 6
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
Reading of uninitialized local variables is broken #6
Comments
Stefan, good catch, same happens in TruffleMate and I guess in TruffleSOM. But, have you tried the proposed patch? Anyway, my impression is that each LocalVarNode* should have its own Slot (clone the slot at creation time) while they are sharing it right now. |
The patch is for SOMns, it fixed the example above. I haven't tested it beyond that. I am not sure exactly what you are referring to with the LocalVarNode* and having their own slot. The frame is actually tracking whether the slot is set. It has an array of tags. That could potentially also be used to mark a variable as unwritten again (for issue #5). |
Yes. What I said was complete nonsense. It would even be incorrect. What I was trying to think is something like this: |
Reading of uninitialized variables in methods is likely broken. At least it is in SOMns.
The following test fails with an assertion, because the read evaluates to
null
:A fix could be:
/cc @charig
The text was updated successfully, but these errors were encountered: