[CodeGen] Handle __func__ inside __finally
authorShoaib Meenai <smeenai@fb.com>
Wed, 11 Apr 2018 18:17:35 +0000 (18:17 +0000)
committerShoaib Meenai <smeenai@fb.com>
Wed, 11 Apr 2018 18:17:35 +0000 (18:17 +0000)
commit34aa13169b5aed623c227191bb36fa118d766ba1
tree9bede0c60bdd05f74664f1abe32092638434099c
parentb24953bbfbc99b21d01ffaf673e11a44b4951b90
[CodeGen] Handle __func__ inside __finally

When we enter a __finally block, the CGF's CurCodeDecl will be null
(because CodeGenFunction::StartFunction is given an empty GlobalDecl for
a __finally block), and so the dyn_cast here will result in an assertion
failure. Change it to dyn_cast_or_null to handle this case.

Differential Revision: https://reviews.llvm.org/D45523

llvm-svn: 329836
clang/lib/CodeGen/CGExpr.cpp
clang/test/CodeGen/exceptions-seh-finally.c