llvm-project/clang/lib/AST
George Burgess IV 4168d75888 [ExprConstant] Fix PR28314 - crash while evluating objectsize.
This fixes a crash in code like:
```
struct A {
  struct B b;
  char c[1];
}

int foo(struct A* a) { return __builtin_object_size(a->c, 0); }
```

We wouldn't check whether the structs we were examining were invalid,
and getting the layout of an invalid struct is (unsurprisingly) A Bad
Thing. With this patch, we'll always return conservatively if we see an
invalid struct, since I'm assuming the presence of an invalid struct
means that our compilation failed (so having a conservative result isn't
such a big deal).

llvm-svn: 273911
2016-06-27 19:40:41 +00:00
..
APValue.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
ASTConsumer.cpp Move LocInfoType from Sema to AST. 2016-02-01 17:42:01 +00:00
ASTContext.cpp Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a 2016-06-25 00:15:56 +00:00
ASTDiagnostic.cpp Apply some suggestions from clang-tidy's performance-unnecessary-value-param. 2016-06-15 14:20:56 +00:00
ASTDumper.cpp Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a 2016-06-25 00:15:56 +00:00
ASTImporter.cpp Use more ArrayRefs 2016-06-24 04:05:48 +00:00
ASTTypeTraits.cpp Reorder ASTNodeKind::AllKindInfo to match NodeKindId. 2016-04-14 00:47:40 +00:00
AttrImpl.cpp Devirtualize Attr and all subclasses. 2015-03-19 16:06:49 +00:00
CMakeLists.txt Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
CXXABI.h [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
CXXInheritance.cpp Fix PR27601 by reverting [r267453] - Refactor traversal of bases in deduction of template parameters from base 2016-05-19 02:28:21 +00:00
Comment.cpp Use more ArrayRefs 2016-06-24 04:05:48 +00:00
CommentBriefParser.cpp
CommentCommandTraits.cpp Fix for PR21254 - Assertion in comment parser 2014-10-15 16:18:20 +00:00
CommentLexer.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
CommentParser.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
CommentSema.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
Decl.cpp Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a 2016-06-25 00:15:56 +00:00
DeclBase.cpp Don't use static variables in LambdaCapture 2016-06-15 14:14:51 +00:00
DeclCXX.cpp Revert "[ASTMatchers] New forEachOverriden matcher." 2016-06-11 04:45:38 +00:00
DeclFriend.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclGroup.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclObjC.cpp Fix ObjCMethodDecl::findPropertyDecl for class properties. 2016-03-11 21:14:40 +00:00
DeclOpenMP.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
DeclPrinter.cpp Use more ArrayRefs 2016-06-24 04:05:48 +00:00
DeclTemplate.cpp ArrayRef-ize TemplateParameterList. NFC 2015-12-27 07:16:27 +00:00
DeclarationName.cpp Make Sema::getPrintingPolicy less ridiculously expensive. This used to perform 2016-05-19 01:39:10 +00:00
Expr.cpp Use ranges to concisely express iteration 2016-06-23 00:15:04 +00:00
ExprCXX.cpp Re-commit "[Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr." 2016-06-21 20:29:17 +00:00
ExprClassification.cpp [MSVC] 'property' with an empty array in array subscript expression. 2015-11-25 12:01:00 +00:00
ExprConstant.cpp [ExprConstant] Fix PR28314 - crash while evluating objectsize. 2016-06-27 19:40:41 +00:00
ExprObjC.cpp [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h" 2015-12-31 06:01:19 +00:00
ExternalASTSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
InheritViz.cpp InheritViz: Hide implementation details 2015-03-09 15:03:20 +00:00
ItaniumCXXABI.cpp [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
ItaniumMangle.cpp Delete dead code. 2016-06-21 19:19:31 +00:00
Mangle.cpp Make TargetInfo store an actual DataLayout instead of a string. 2016-03-04 19:00:41 +00:00
MicrosoftCXXABI.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
MicrosoftMangle.cpp [MSVC2015] Fix mangling for static variables initialization guards 2016-05-27 08:52:34 +00:00
NSAPI.cpp Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
NestedNameSpecifier.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
OpenMPClause.cpp [OpenMP] Parsing and sema support for the from clause 2016-05-26 17:49:04 +00:00
ParentMap.cpp Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
RawCommentList.cpp Allow any comment to be a trailing comment when -fparse-all-comments is on. 2015-07-15 19:13:39 +00:00
RecordLayout.cpp [RecordLayout] Use an ASTVector instead of using a separate pointer and counter 2016-05-24 18:10:50 +00:00
RecordLayoutBuilder.cpp [RecordLayout] Use an ASTVector instead of using a separate pointer and counter 2016-05-24 18:10:50 +00:00
SelectorLocationsKind.cpp
Stmt.cpp Implement p0292r2 (constexpr if), a likely C++1z feature. 2016-06-23 19:16:49 +00:00
StmtCXX.cpp Revert accidential "[MSVC] Late parsing of in-class defined member functions in template" 2016-06-15 11:24:54 +00:00
StmtIterator.cpp [ptr-traits] Stop using two bogus types as stand-ins for flags 2015-12-30 02:51:00 +00:00
StmtObjC.cpp Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
StmtOpenMP.cpp Resubmission of http://reviews.llvm.org/D21564 after fixes. 2016-06-27 14:55:37 +00:00
StmtPrinter.cpp Resubmission of http://reviews.llvm.org/D21564 after fixes. 2016-06-27 14:55:37 +00:00
StmtProfile.cpp Resubmission of http://reviews.llvm.org/D21564 after fixes. 2016-06-27 14:55:37 +00:00
StmtViz.cpp
TemplateBase.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
TemplateName.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
Type.cpp [ObjC] Remove _Atomic from return type and parameter type of 2016-05-26 00:37:30 +00:00
TypeLoc.cpp Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
TypePrinter.cpp Make Sema::getPrintingPolicy less ridiculously expensive. This used to perform 2016-05-19 01:39:10 +00:00
VTTBuilder.cpp Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept. 2014-11-19 07:49:47 +00:00
VTableBuilder.cpp Revert "[MS] Don't expect vftables to be provided for extern template instantiations" 2016-06-21 19:51:52 +00:00