summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-04 18:10:26 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-04 18:10:26 +0000
commitc42075a164468aa35e30c7ea5f158d0f825aca21 (patch)
treed326e9affe6931077dda22d2ade38c69a0813dc3 /llvm/lib/CodeGen/ProcessImplicitDefs.cpp
parent824e0613deaff8628ef6a7c9296802698994a0d2 (diff)
downloadbcm5719-llvm-c42075a164468aa35e30c7ea5f158d0f825aca21.tar.gz
bcm5719-llvm-c42075a164468aa35e30c7ea5f158d0f825aca21.zip
Fix an obscure crash found in the Boost.MPL test suite, along with a
ton of potential crashes of the same kind. The fundamental problem is that type creation was following a dangerous pattern when using its FoldingSets: 1) Use FindNodeOrInsertPos to see if the type is available 2) If not, and we aren't looking at a canonical type, build the canonical type 3) Build and insert the new node into the FoldingSet The problem here is that building the canonical type can, in very rare circumstances, force the hash table inside the FoldingSet to reallocate. That invalidates the insertion position we computed in step 1, and in step 3 we end up inserting the new node into the wrong place. BOOM! I've audited all of ASTContext, fixing this problem everywhere I found it. The vast majority of wrong code was C++-specific (and *ahem* written by me), so I also audited other major folding sets in the C++ code (e.g., template specializations), but found no other instances of this problem. llvm-svn: 95315
Diffstat (limited to 'llvm/lib/CodeGen/ProcessImplicitDefs.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud