diff options
| author | Anders Carlsson <andersca@mac.com> | 2007-11-30 19:04:31 +0000 | 
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2007-11-30 19:04:31 +0000 | 
| commit | 801c5c74677fa615bbe5c18576f38499c8d3f82c (patch) | |
| tree | 17ef3c0afa808787ceb103f2408e40f067f4e35d /clang/Analysis | |
| parent | 907703cecddca73eaaa1c4d3c4fdf9ef8c9bd987 (diff) | |
| download | bcm5719-llvm-801c5c74677fa615bbe5c18576f38499c8d3f82c.tar.gz bcm5719-llvm-801c5c74677fa615bbe5c18576f38499c8d3f82c.zip  | |
GCC has an extension where the left hand side of the ? : operator can be omitted. Handle this in a few more places.
llvm-svn: 44462
Diffstat (limited to 'clang/Analysis')
| -rw-r--r-- | clang/Analysis/UninitializedValues.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/Analysis/UninitializedValues.cpp b/clang/Analysis/UninitializedValues.cpp index 8a27b71b8fd..35d6124e621 100644 --- a/clang/Analysis/UninitializedValues.cpp +++ b/clang/Analysis/UninitializedValues.cpp @@ -145,7 +145,13 @@ bool TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {  bool TransferFuncs::VisitConditionalOperator(ConditionalOperator* C) {    Visit(C->getCond()); -  return Visit(C->getLHS()) & Visit(C->getRHS());  // Yes: we want &, not &&. + +  bool rhsResult = Visit(C->getRHS()); +  // Handle the GNU extension for missing LHS. +  if (Expr *lhs = C->getLHS()) +    return Visit(lhs) & rhsResult; // Yes: we want &, not &&. +  else +    return rhsResult;  }  bool TransferFuncs::VisitStmt(Stmt* S) {  | 

