Closed arichardson closed 4 years ago
Full source file is:
#include <stdio.h>
int main() {
static const void *L[] = {&&L1, &&L2, &&L3, &&L4, 0 };
unsigned i = 0;
printf("A\n");
L1:
printf("B\n");
L2:
printf("C\n");
L3:
printf("D\n");
goto *L[i++];
L4:
printf("E\n");
return 0;
}
Fixed a long time ago.
Happens when compiling 2004-03-15-IndirectGoto.c from llvm-test-suite for CheriABI
lib/IR/Constants.cpp:1431: static llvm::Constant *llvm::ConstantExpr::getCast(unsigned int, llvm::Constant *, llvm::Type *, bool): Assertion `CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"' failed.
reduced test case: