aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index a3f8301578..5bdb016738 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -791,7 +791,9 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV) {
return RValue::get(EmitARCLoadWeak(LV.getAddress()));
if (LV.isSimple()) {
- assert(!LV.getType()->isFunctionType());
+ // Functions are l-values that don't require loading.
+ if (LV.getType()->isFunctionType())
+ return RValue::get(LV.getAddress());
// Everything needs a load.
return RValue::get(EmitLoadOfScalar(LV));