diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-01-03 00:39:26 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-01-03 00:39:26 +0000 |
commit | 33accdf602a9191caa0a42c4400241def6613af5 (patch) | |
tree | 904bac0da199e5460ffd7b6f5e9c040666e589c3 /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | 3fdcc0bda3c486c371159acdbc370933860dbe42 (diff) | |
download | bcm5719-llvm-33accdf602a9191caa0a42c4400241def6613af5.tar.gz bcm5719-llvm-33accdf602a9191caa0a42c4400241def6613af5.zip |
Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope. PR14773.
llvm-svn: 171433
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index f5bf2a2fe7a..7a604013b79 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -905,10 +905,8 @@ public: if (!VD->hasLocalStorage()) { if (VD->isFileVarDecl() || VD->hasExternalStorage()) return CGM.GetAddrOfGlobalVar(VD); - else if (VD->isLocalVarDecl()) { - assert(CGF && "Can't access static local vars without CGF"); - return CGF->GetAddrOfStaticLocalVar(VD); - } + else if (VD->isLocalVarDecl()) + return CGM.getStaticLocalDeclAddress(VD); } } return 0; |