CTSRD-CHERI / clang

DO NOT USE. Use llvm-project instead
Other
9 stars 8 forks source link

Clang assertion fails generating IR for atomic builtins #118

Closed davidchisnall closed 7 years ago

davidchisnall commented 7 years ago

Test case:

void fail(void)
{
 _Atomic(_Bool) obj;
 __c11_atomic_exchange(&obj, 1, 5);
}

Generates an assertion failure because of an invalid bitcast from a pointer to an integer.

Compile with -mabi=sandbox to trigger the assertion failure.

davidchisnall commented 7 years ago

Bug appears to be CGAtomic.cpp:1065 - cast is ignoring address space.

davidchisnall commented 7 years ago

Fixed in 335556b8170e39e6d720dcbda1d43a4533aee048