summaryrefslogtreecommitdiffstats
path: root/clang/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
commit8d7ff4098ccff8ce137ce487c24eb55ffc445dfb (patch)
tree158a2ee9c8a898d777be37baff468cd48bc9defe /clang/lib/Sema/SemaStmt.cpp
parent97f1f1c46e7ba0a208cef09406ca6301607027e2 (diff)
downloadbcm5719-llvm-8d7ff4098ccff8ce137ce487c24eb55ffc445dfb.tar.gz
bcm5719-llvm-8d7ff4098ccff8ce137ce487c24eb55ffc445dfb.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 39f21f853a3..4ef0fda3612 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud