]> granicus.if.org Git - clang/commit
Avoid iteration invalidation issues around MaterializedTemporaryExpr
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 13 Aug 2015 23:50:15 +0000 (23:50 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 13 Aug 2015 23:50:15 +0000 (23:50 +0000)
commit20f7922a2419502b9bcf4b89384d237da53a0ac5
tree43b428873ea9d6622726a679b0d8beee12941610
parent2b8eebed9b99e54df26c1877c39b0625ad8b906e
Avoid iteration invalidation issues around MaterializedTemporaryExpr

We risk iterator invalidation issues if we use a DenseMap to hold the
backing storage for an APValue.  Instead, BumpPtrAllocate them and
use APValue * as our DenseMap value.

Also, don't assume that MaterializedGlobalTemporaryMap won't regrow
between when we initially perform a lookup and later on when we actually
try to insert into it.

This fixes PR24289.

Differential Revision: http://reviews.llvm.org/D11629

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244989 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/CodeGen/CodeGenModule.cpp
test/CodeGenCXX/PR24289.cpp [new file with mode: 0644]