[llvm-bugs] [Bug 33897] New: Crash with invalid cast inside vector literal
llvm-bugs at lists.llvm.org
Sat Jul 22 11:37:50 PDT 2017
Bug ID: 33897
Summary: Crash with invalid cast inside vector literal
Assignee: unassignedclangbugs at nondot.org
Reporter: J.Price at bristol.ac.uk
CC: llvm-bugs at lists.llvm.org
Created attachment 18835
The following code causes Clang/Sema to hit an `llvm_unreachable` with message
'illegal cast from pointer':
kernel void A(global float* b)
This only happens when using the single element form of the vector literal.
Other forms produce the correct diagnostic ("initializing 'float' with an
expression of incompatible type ...").
There's a special case for this single element form (SemaExpr.cpp line 6083),
but it doesn't seem to validate the types before calling PrepareScalarCast(),
which assumes the inputs are valid.
Full stack trace attached.
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs