-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Compiler: fix closured instance variable not being considered as such #8588
Conversation
It doesn't, but the approach is a good start... to fix this I'll also have to fix #3093 . I'll see if I can do that this week. |
Actually this is already pretty good and #3093 might not be necessary to go with this fix, though it is a small breaking change because in some cases the compiler won't realize that a closured var doesn't actually change, like before, but in cases where it previously (incorrectly) didn't. I'll still try to think of a way to do #3093 but if I can't we should at least go with this fix because #5609 is pretty nasty (code compiles and runs, but runs incorrectly). |
It worked! I think we should merge this now, even though this is a small breaking change. In the compiler and std source code I had to change two places to make it work well. Basically, previously the compiler would check whether a variable was closured and bind all assigned types to it regardless of |
The breaking change seems very counter-intuitive to me. The change in |
0400a6d
to
cea97ef
Compare
Strange, it works fine in mac but not in linux... no idea why. |
I guess nevermind, I don't know what's going on... |
As a follow up, I'd really like to go with the three first commits. It's a breaking change, and some places will start failing to compile where previously they didn't, but I prefer that to a segfault or incorrect behavior at runtime. We can make sure no bad semantic is generated first, then we can worry about making it work for cases where it doesn't but should. I won't do it, but feel free to do that for 0.33.0. |
b4f996a
to
f2d72f5
Compare
Could someone using linux try running the specs locally? They work fine in my mac, and linux CI is having issues lately so I'm not sure it's related to these changes. |
@RX14 thanks, but this PR was failing in linux before that started happening. That's why I'd like someone to run the entire spec suit (with a compiled compiler too) in Linux on their machine, not on CI. |
Under WSL (not exactly supported target, but what i have.)
|
Thanks! I'm still not sure if it's a problem with this branch or not... it's so strange that it works just fine in darwin. Maybe someone with real linux and not WSL? |
FWIW I've tried lld-8 as suggested in #7177 (comment) (still on WSL)
|
Thanks! Then yes, there's something wrong in linux. Unfortunately I won't be able to continue working on this to find our what's wrong, but if someone wants to debug it please go ahead. |
@asterite the error happens when you exceed a total number of types (really, llvm modules) in the program. Any new PRs which add more generic instantiations or types can trigger this. The linker corrupts the object file and you'll get a runtime link error. It works in darwin because osx uses lld by default. |
@RX14 but if you look at the last output provided a couple of comments above you'll see the specs start running, one passes and then it crashes. Do you think that's related to what you are saying? |
Not the version compiled with |
f2d72f5
to
7bbf9e6
Compare
This didn't work, so closing. |
Hopefully fixes #5609, take 2