Opened 5 months ago

Last modified 5 months ago

#232 new defect

Crash: address-of should not have intrinsic reference argument

Reported by: Thierry Delisle Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

The code crashes the compiler due to an assertion:

CFA assertion error* "false" from program "cfa-cpp" in "Expression* GenPoly::{anonymous}::AddrRef::postmutate(AddressExpr?*)" at line 302 in file "../../main/src/GenPoly/Lvalue.cc": AddrRef? : address-of should not have intrinsic reference argument: Application of [...]

extern "C" {
	#include <sys/select.h>
}

int main() {
	fd_set fds;
	FD_ZERO(&fds);
	FD_SET(0, &fds);
}

Change History (1)

comment:1 Changed 5 months ago by pabuhr

Smaller repo with same error

typedef struct {
    long int __fds_bits[10];
} fd_set;

int main() {
    fd_set fds;
    (&( &fds )->__fds_bits[0]); // works
    __asm__ ( "" : "" (&( &fds )->__fds_bits[0]) ); // fails
}
Note: See TracTickets for help on using tickets.