diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-03-12 19:19:19 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-03-12 19:19:19 +0100 |
commit | 5490b0b21a4089d803d51c91311430d60d266f7b (patch) | |
tree | 93839af1790439c3c71c1164b3dbe7ecd4370e9c /tests | |
parent | 979ef7c1c22d899df42d133e89f690b8ee34ee02 (diff) | |
download | vala-5490b0b21a4089d803d51c91311430d60d266f7b.tar.gz |
codegen: Reset outdated array _size_ variable after use as ref parameter
Fixes https://gitlab.gnome.org/GNOME/vala/issues/929
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/methods/parameter-ref-array-resize.vala | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 6c74a3186..dcda2cbe0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -118,6 +118,7 @@ TESTS = \ methods/contains.vala \ methods/extern.vala \ methods/iterator.vala \ + methods/parameter-ref-array-resize.vala \ methods/prepostconditions.vala \ methods/same-name.vala \ methods/symbolresolution.vala \ diff --git a/tests/methods/parameter-ref-array-resize.vala b/tests/methods/parameter-ref-array-resize.vala new file mode 100644 index 000000000..ffe27d35b --- /dev/null +++ b/tests/methods/parameter-ref-array-resize.vala @@ -0,0 +1,11 @@ +void foo (ref int[] a) { + a = new int[1]; +} + +void main() { + int[] a = new int[10 * 1024 * 1024]; + foo (ref a); + for (int i = 1; i < 10 * 1024 * 1024; i++) { + a += 4711; + } +} |