Opened 8 years ago
Closed 8 years ago
#55 closed defect (fixed)
intrusive stack crash
| Reported by: | Thierry Delisle | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description
This code crashes the compiler :
#define NULL (void*)0
trait is_node(dtype T) {
T*& get_next( T& );
};
forall(dtype T | is_node(T))
struct __stack {
T * top;
};
forall(dtype T | is_node(T))
void ?{}( __stack(T) & this ) {
this.top = NULL;
}
forall(dtype T | is_node(T) | sized(T))
void push( __stack(T) & this, T * val ) {
get_next( *val ) = this.top;
this.top = val;
}
forall(dtype T | is_node(T) | sized(T))
T * pop( __stack(T) & this ) {
T * top = this.top;
if( top ) {
this.top = get_next( *top );
get_next( *top ) = NULL;
}
return top;
}
struct node;
static inline node *& get_next( node & this );
__stack(node) n;
struct node {
node * next;
};
static inline node *& get_next( node & this ) { return this.next; }
Change History (1)
comment:1 by , 8 years ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 760ba67: