Lines Matching defs:arg
6 int irrelevantAssumptions(int arg) {
7 int a = TenElements[arg];
8 // Here the analyzer assumes that `arg` is in bounds, but doesn't report this
9 // because `arg` is not interesting for the bug.
17 int assumingBoth(int arg) {
18 int a = TenElements[arg];
20 int b = TenElements[arg]; // no additional note, we already assumed that 'arg' is in bounds
21 int c = TenElements[arg + 10];
27 int assumingBothPointerToMiddle(int arg) {
31 int a = p[arg];
35 // and says that `p[arg]` is just an UnknownVal (instead of calculating that
36 // it's equivalent to `TenElements[2+arg]`).
38 int b = TenElements[arg]; // This is normal access, and only the lower bound is new.
40 int c = TenElements[arg + 10];
46 int assumingLower(int arg) {
47 // expected-note@+2 {{Assuming 'arg' is < 10}}
49 if (arg >= 10)
51 int a = TenElements[arg];
53 int b = TenElements[arg + 10];
59 int assumingUpper(int arg) {
60 // expected-note@+2 {{Assuming 'arg' is >= 0}}
62 if (arg < 0)
64 int a = TenElements[arg];
66 int b = TenElements[arg - 10];
72 int assumingUpperIrrelevant(int arg) {
74 // it's assuming something about the interesting variable `arg`; however,
76 // deduced from the _lower_ bound on `arg`. Currently the analyzer cannot
80 // expected-note@+2 {{Assuming 'arg' is >= 0}}
82 if (arg < 0)
84 int a = TenElements[arg];
86 int b = TenElements[arg + 10];
92 int assumingUpperUnsigned(unsigned arg) {
93 int a = TenElements[arg];
95 int b = TenElements[(int)arg - 10];
101 int assumingNothing(unsigned arg) {
102 // expected-note@+2 {{Assuming 'arg' is < 10}}
104 if (arg >= 10)
106 int a = TenElements[arg]; // no note here, we already know that 'arg' is in bounds
107 int b = TenElements[(int)arg - 10];
113 short assumingConvertedToCharP(int arg) {
117 char a = cp[arg];
119 char b = cp[arg]; // no additional note, we already assumed that 'arg' is in bounds
120 char c = cp[arg + 40];
132 int assumingConvertedToIntP(struct foo f, int arg) {
135 int a = ((int*)(f.a))[arg];
139 int b = ((int*)(f.b))[arg];
141 int c = TenElements[arg-2];
147 int assumingPlainOffset(struct foo f, int arg) {
152 // expected-note@+2 {{Assuming 'arg' is < 2}}
154 if (arg >= 2)
157 int b = ((int*)(f.b))[arg];
160 // but the current simplification algorithm doesn't realize that arg <= 1
161 // implies that the byte offset arg*4 will be less than 5.
163 int c = TenElements[arg+10];
173 int assumingExtent(int arg) {
176 int *mem = (int*)malloc(arg);
183 return TenElements[arg];
188 int *extentInterestingness(int arg) {
191 int *mem = (int*)malloc(arg);
193 TenElements[arg] = 123;