Fix a null pointer dereference error due to state caching in a loop involving
sending a message to a nil receiver. llvm-svn: 68686
This commit is contained in:
		
							parent
							
								
									cb5d3ced70
								
							
						
					
					
						commit
						2f3b0dbff4
					
				| 
						 | 
				
			
			@ -1704,10 +1704,8 @@ void GRExprEngine::VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME,
 | 
			
		|||
            N->markAsSink();
 | 
			
		||||
            if (isFeasibleNotNull)
 | 
			
		||||
              NilReceiverStructRetImplicit.insert(N);
 | 
			
		||||
            else {
 | 
			
		||||
            else
 | 
			
		||||
              NilReceiverStructRetExplicit.insert(N);            
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -1725,10 +1723,8 @@ void GRExprEngine::VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME,
 | 
			
		|||
                N->markAsSink();
 | 
			
		||||
                if(isFeasibleNotNull)
 | 
			
		||||
                  NilReceiverLargerThanVoidPtrRetImplicit.insert(N);
 | 
			
		||||
                else {
 | 
			
		||||
                else
 | 
			
		||||
                  NilReceiverLargerThanVoidPtrRetExplicit.insert(N);            
 | 
			
		||||
                  return;
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
            else if (!isFeasibleNotNull) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1754,6 +1750,9 @@ void GRExprEngine::VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME,
 | 
			
		|||
      }
 | 
			
		||||
      // We have handled the cases where the receiver is nil.  The remainder
 | 
			
		||||
      // of this method should assume that the receiver is not nil.
 | 
			
		||||
      if (!StNotNull)
 | 
			
		||||
        return;
 | 
			
		||||
       
 | 
			
		||||
      state = StNotNull;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue