mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
Eliminate obvious use-after-free. Fixes PR12433 / <rdar://problem/11168333>.
llvm-svn: 153982
This commit is contained in:
parent
7e5b4c9328
commit
6a37784a35
@ -3898,9 +3898,9 @@ QualType ASTReader::readTypeRecord(unsigned Index) {
|
||||
ExceptionSpecificationType EST =
|
||||
static_cast<ExceptionSpecificationType>(Record[Idx++]);
|
||||
EPI.ExceptionSpecType = EST;
|
||||
SmallVector<QualType, 2> Exceptions;
|
||||
if (EST == EST_Dynamic) {
|
||||
EPI.NumExceptions = Record[Idx++];
|
||||
SmallVector<QualType, 2> Exceptions;
|
||||
for (unsigned I = 0; I != EPI.NumExceptions; ++I)
|
||||
Exceptions.push_back(readType(*Loc.F, Record, Idx));
|
||||
EPI.Exceptions = Exceptions.data();
|
||||
|
10
clang/test/PCH/cxx-functions.cpp
Normal file
10
clang/test/PCH/cxx-functions.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
// Test this without pch.
|
||||
// RUN: %clang_cc1 -include %S/cxx-functions.h -fsyntax-only -verify %s
|
||||
|
||||
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-functions.h
|
||||
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
|
||||
|
||||
|
||||
void test_foo() {
|
||||
foo();
|
||||
}
|
1
clang/test/PCH/cxx-functions.h
Normal file
1
clang/test/PCH/cxx-functions.h
Normal file
@ -0,0 +1 @@
|
||||
void foo() throw( int, short, char, float, double );
|
Loading…
Reference in New Issue
Block a user