forked from OSchip/llvm-project
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:
parent
97f1f1c46e
commit
8d7ff4098c
|
@ -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
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// RUN: clang-cc -emit-llvm-bc -o - %s
|
||||
// PR3869
|
||||
int a(long long b) { goto *b; }
|
||||
|
Loading…
Reference in New Issue