[cfe-dev] Clang crashing unexpectedly

Bruno Ricci via cfe-dev cfe-dev at lists.llvm.org
Sat Mar 16 06:31:17 PDT 2019



On 16/03/2019 02:18, Zoe Carver via cfe-dev wrote:
> I found that clang crashes when it should not. I brought up the issue in the LLVM IRC channel earlier and was told to send an email describing the problem (the LLVM Bugzilla has not verified me yet).
> 
> Here is a simple example of a program which crashes:
> 
> int main () {
> 
> return __builtin_coro_size();
> 
> }
> 
> 
> This behavior happens with many of the coroutine builtins. Take another example:
> 
> 
> void* alloc = malloc(1024);
> 
> void* ptr = __builtin_coro_begin(alloc);
> 
> return __builtin_coro_free(ptr);
> 
> 
> Here is a Godbolt to help demonstrate the problem: https://godbolt.org/z/L1v1rs
> 
> I /think /(but totally might be wrong)/ /that the issue has to do with clang ("CGBuiltin.cpp") returning a different type than was specified in "Builtins.def". 
> 
> Anyway, let me know if you have questions. Hope this helps. 

Am I reading this correctly ? The coroutine intrinsics have never worked since introduced in clang 4 ? (At least this is what I am getting on godbolt).



More information about the cfe-dev mailing list