https://github.com/epiqc/ScaffCC
Raw File
Tip revision: 4d7bfa034cfaea4e8346396c6198cdd3e271d272 authored by Andrew Litteken on 23 April 2020, 16:55:47 UTC
Version 5 Upgrade! (#40)
Tip revision: 4d7bfa0
reference.mm
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-null-dereference %s

@interface Foo
- (int &)ref;
@end

Foo *getFoo() { return 0; }

void testNullPointerSuppression() {
	getFoo().ref = 1;
}

void testPositiveNullReference() {
  Foo *x = 0;
	x.ref = 1; // expected-warning {{The receiver of message 'ref' is nil, which results in forming a null reference}}
}

back to top