diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-30 17:56:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-30 17:56:23 +0000 |
commit | 2202bce80fc72d067cbe67dc1512f7b45351fd31 (patch) | |
tree | 99baa6f1553eda7239be17c35d2c9a182cae34c9 /CodeGen/CGExpr.cpp | |
parent | c69a5810f4a39f4af204e4843b497033ec6f12bf (diff) |
Fix a codegen crash on void ?: reported by Oliver
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CGExpr.cpp')
-rw-r--r-- | CodeGen/CGExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index f9a00ebfee..8fcc94805a 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -492,6 +492,11 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, const CallExpr *E) { else if (hasAggregateLLVMType(E->getType())) // Struct return. return RValue::getAggregate(Args[0]); + else { + // void return. + assert(E->getType()->isVoidType() && "Should only have a void expr here"); + V = 0; + } return RValue::get(V); } |