Fix for PR3869: actually enforce that the argument of an indirect goto

is of type void*.  I'll try to add the appropriate checking later.

llvm-svn: 67721
This commit is contained in:
Eli Friedman 2009-03-26 00:18:06 +00:00
parent 97f1f1c46e
commit 8d7ff4098c
2 changed files with 8 additions and 2 deletions

View File

@ -688,8 +688,10 @@ Action::OwningStmtResult
Sema::ActOnIndirectGotoStmt(SourceLocation GotoLoc,SourceLocation StarLoc,
ExprArg DestExp) {
// FIXME: Verify that the operand is convertible to void*.
return Owned(new (Context) IndirectGotoStmt((Expr*)DestExp.release()));
// Convert operand to void*
Expr* E = (Expr*)DestExp.release();
ImpCastExprToType(E, Context.VoidPtrTy);
return Owned(new (Context) IndirectGotoStmt(E));
}
Action::OwningStmtResult

View File

@ -0,0 +1,4 @@
// RUN: clang-cc -emit-llvm-bc -o - %s
// PR3869
int a(long long b) { goto *b; }