Lines Matching defs:TenElements

4 int TenElements[10];
7 TenElements[-3] = 5;
8 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
9 // expected-note@-2 {{Access of 'TenElements' at negative byte offset -12}}
13 int *p = TenElements;
16 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
17 // expected-note@-2 {{Access of 'TenElements' at negative byte offset -4}}
36 TenElements[getIndex()] = 10;
37 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
38 // expected-note@-2 {{Access of 'TenElements' at negative byte offset -688}}
48 TenElements[index] = 5;
49 // expected-warning@-1 {{Potential out of bound access to 'TenElements' with tainted index}}
50 // expected-note@-2 {{Access of 'TenElements' with a tainted index that may be negative or too large}}
64 TenElements[index] = 5;
65 // expected-warning@-1 {{Potential out of bound access to 'TenElements' with tainted index}}
66 // expected-note@-2 {{Access of 'TenElements' with a tainted index that may be too large}}
75 TenElements[index] = 5;
76 // expected-warning@-1 {{Potential out of bound access to 'TenElements' with tainted index}}
77 // expected-note@-2 {{Access of 'TenElements' with a tainted index that may be too large}}
82 // &TenElements[10] is the after-the-end pointer which is well-defined; but
84 // `&TenElements[size]`, so it's better to report an error. This report can
85 // be easily silenced by writing TenElements+index instead of
86 // &TenElements[index].
92 return TenElements;
97 return &TenElements[index];
98 // expected-warning@-1 {{Potential out of bound access to 'TenElements' with tainted index}}
99 // expected-note@-2 {{Access of 'TenElements' with a tainted index that may be too large}}
107 int *p = TenElements + index;
109 // expected-warning@-1 {{Potential out of bound access to 'TenElements' with tainted offset}}
110 // expected-note@-2 {{Access of 'TenElements' with a tainted offset that may be negative or too large}}
114 TenElements[12] = 5;
115 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
116 // expected-note@-2 {{Access of 'TenElements' at index 12, while it holds only 10 'int' elements}}
120 12[TenElements] = 5;
121 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
122 // expected-note@-2 {{Access of 'TenElements' at index 12, while it holds only 10 'int' elements}}
126 // This is an unusual but standard-compliant way of writing (TenElements + 10).
127 return &TenElements[10]; // no-warning
133 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
134 // expected-note@-2 {{Access of 'TenElements' at index 10, while it holds only 10 'int' elements}}
139 return &TenElements[11];
140 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
141 // expected-note@-2 {{Access of 'TenElements' at index 11, while it holds only 10 'int' elements}}
148 return &TenElements[idx];
149 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
150 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
155 // the idiomatic `&TenElements[size]` expressions. If the report is FP, the
156 // developer can easily silence it by writing TenElements+idx instead of
157 // &TenElements[idx].
166 return TenElements[arg - 1];
167 // expected-warning@-1 {{Out of bound access to memory around 'TenElements'}}
168 // expected-note@-2 {{Access of 'TenElements' at a negative or overflowing index, while it holds only 10 'int' elements}}
235 return ((short*)TenElements)[47];
236 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
237 // expected-note@-2 {{Access of 'TenElements' at index 47, while it holds only 20 'short' elements}}
350 TenElements[arg] = -2;
351 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
352 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}