-
Notifications
You must be signed in to change notification settings - Fork 129
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
Crash for comma in array subscript #43
Comments
The crash stems from a failure of the following assertion in the
Generally,
As you requested, I rephrased the assertion as an error.
I'll be the first to admit it's an ugly patch. I tried following the erroneous
I also discovered that the above code successfully compiles yet produces a length vn int array of zeroes...How tedious would it be to disallow commas inside hard brackets everywhere except for the left side of the @=> operator? |
Hey Tim, Cool, thats a good analysis. I think the most general solution would be to disallow comma expressions in array subscripts (e.g., right after a variable name) while continuing to allow them in array literals, though Im not sure off the top of my head where that distinction is made in the parser/compiler system. Ideally it could be caught in the .y file which defines ChucK's grammar. Your proposed patch seems like a good solution to start with; if you want to make a pull request with that change, that'd be great! spencer |
As requested in issue ccrma#43. This addresses but one issue of potentially many brought upon by not disallowing commas in array subscripts.
As requested in issue ccrma#43. This addresses but one issue of potentially many brought upon by not disallowing commas in array subscripts.
As requested in issue ccrma#43. This addresses but one issue of potentially many brought upon by not disallowing commas in array subscripts.
As requested in [issue ccrma#43](ccrma#43 (comment)). This addresses but one issue of potentially many brought upon by not disallowing commas in array subscripts.
Christ, this looks like a warzone... Was just trying to change my branch's name.. Okay finally got it probably. I need to sleep now |
As requested in [issue #43](#43 (comment)). This addresses but one issue of potentially many brought upon by not disallowing commas in array subscripts.
thanks to @tim-torres and @spencersalazar, this issue is marked as resolved!
|
The following code causes ChucK to crash during compilation:
The issue seems to be the comma in the array subscript, which is not valid syntax, but should generate a compile error rather than crashing.
The text was updated successfully, but these errors were encountered: