aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-03-26 00:18:06 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-03-26 00:18:06 +0000
commitbbf462314b1dc8e422b7c4dd4cac47e566aedf6d (patch)
treed5bb834eaf5eb4da945e029e8268865eb7246db3 /lib/Sema/SemaStmt.cpp
parentbefc20e1dc869edb0e7b560e69f32d5c71f867ab (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 39f21f853a..4ef0fda361 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -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