diff options
author | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-06-13 13:04:13 +0100 |
---|---|---|
committer | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-06-13 13:04:13 +0100 |
commit | d51ad9622d0913564870db50f8ab95d7cba30452 (patch) | |
tree | e7308545a436d8be0510a945597db093ee90257e /test | |
parent | 71b6f483093599088c48d166dbe496b64462bd4b (diff) | |
download | vericert-kvx-d51ad9622d0913564870db50f8ab95d7cba30452.tar.gz vericert-kvx-d51ad9622d0913564870db50f8ab95d7cba30452.zip |
out of bounds - x[2] is y[0]
Diffstat (limited to 'test')
-rw-r--r-- | test/array-out-of-bounds.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/array-out-of-bounds.c b/test/array-out-of-bounds.c new file mode 100644 index 0000000..425bf39 --- /dev/null +++ b/test/array-out-of-bounds.c @@ -0,0 +1,9 @@ +int main() { + int x[2] = {1, 2}; + int y[2] = {3, 4}; + x[2] = 0; + int sum = 0; + for(int i=0; i<2; i++) + sum += (x[i] * y[i]); + +} |