aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/8-runtime/pointer_index_n_traps_memdebug.zc
blob: 49d914a5bc52457cc7e6fc11779ffae6dbea6597 (plain) (blame)
1
2
3
4
5
6
7
8
// expect error: zy: index 11 out of range (length 11)
// spec 8.4 and 4.11: the exact length holds under memdebug too (11 words, a 16-word block)
memdebug on;
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
int at(word* p, int i) { p[i] = 7; return p[i]; }
fn main() { word* p = rt.new(11); pn(at(p, 10)); pn(at(p, 11)); return 0; }
// zc0: skip