aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenTypes.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
commit789b1f640205e81b5af250693246120f1ce9d147 (patch)
treeb909539dd4ed5e8087c421417d947bf1ea15a999 /lib/CodeGen/CodeGenTypes.cpp
parent0dc736627614b476ec696fa216dd2a524d0bafad (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
0 files changed, 0 insertions, 0 deletions