Opened 8 years ago
Last modified 6 years ago
#50 assigned defect
Assertion failure with tuple constructor-expressions
| Reported by: | Rob Schluntz | Owned by: | Rob Schluntz |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description
int main() {
[int, int] x;
x { [5, 5] }; // assert fail
}
The relevant assertion is an unhandled case in FixCtorExprs::postmutate( ConstructorExpr *) for TupleAssignExpr.
Change History (2)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
#include <stdlib.hfa>
int main (void) {
int * x = alloc() { 42 };
}
Doesn't seem to cause a problem anymore as of eeaa3e2b4b50ff73386830c663367b7ad89482e1
The assert still breaks on the original snippet.
The offending code is prefixed with "xxx - this can be TupleAssignExpr now. Need to properly handle this case."
The crash is indeed due to a strict cast to ApplicationExpr of a node that is a TupleAssignExpr.
It's in the FixCtorExprs which "Expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument"
I may have reproduced it will a simpler case:
#include <stdlib.hfa> int main (void) { int * x = alloc() { 42 }; }Error message:
The code that is failing here did not exist at the time the original ticket was filed. However it gets this error message now