-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Ampersand operator in for in
loop causes a compiler crash
#2161
Comments
for in
loop causes a compiler crashfor in
loop causes a compiler crash
Actually it seems like any unary operator causes a crash:
|
I cannot replicate this on the current Odin commit, also on Windows 10: package main
main :: proc() {
a := []byte{1, 2, 3}
for &v in a {
}
}
|
Every single one of these also give me the expected syntax error: |
Maybe someone else can replicate it, @kleeon. Leave it open for a bit. 2cd895c is the latest commit, but did you compile this yourself or is this from a downloaded nightly? If the former, can you tell us what version of Visual Studio and the SDK this was compiled against? |
I compiled it myself by running |
I'm on VS 2019 with 10.0.20348.0, but that shouldn't make a difference here. Very curious. |
The example segfaults odin for me, after
|
Cheers. Changed the bug to replicated. |
Can someone give me a stack trace as to how to replicate this? |
I ran it on a different Windows 10 PC and it still crashes. Here is the stack trace:
|
@gingerBill On the latest commit it crashes with assertion failure:
|
I cannot replicate it on my end but I think I understand the problem now, @kleeon. An error has happened but it is trying to proceed as if there wasn't an error. |
@gingerBill thank you, c18e98e fixed it for me:
I think I can close the issue now. |
Version
OS: Windows 10
Context
I was just experimenting with syntax of the language and encountered this bug.
This code crashes the compiler for me.
The text was updated successfully, but these errors were encountered: