Opened 4 years ago
Last modified 4 years ago
#195 new defect
Unnecessary dereference leads to segfault [from ticket #70]
Reported by: | Thierry Delisle | Owned by: | |
---|---|---|---|
Priority: | major | Component: | cfa-cc |
Version: | 1.0 | Keywords: | |
Cc: |
Description
forall( dtype T | sized(T) ) T * foo( void ) { printf( "foo1\n" ); return (T *)0; } forall( dtype T | sized(T) ) T & foo( void ) { printf( "foo2\n" ); return (T &)*(T *)0; } int main( void ) { int * i; int & j; i = foo(); // correctly calls foo1 &j = foo(); // incorrectly calls foo1 instead of foo2 }
This leads to a segfault from a null ptr that should never be dereferenced
Note: See
TracTickets for help on using
tickets.
The description on this ticket is a little confusing and possibly out of date. If the behaviour did change in the last couple months, that could be relevant to an issue I'm currently facing.
Description seems to be stating two issues
A current repro attempt got this behaviour, which is not what the ticket description says: