diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-22 21:22:15 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-22 21:23:16 +0200 |
commit | 80288cd79ea4d4554c624fda027b566d4fea46dd (patch) | |
tree | 28c727d858fca48b9a0aead565b3cd0256c30435 /tests/methods/parameter-ref-array-resize-captured.vala | |
parent | 3dc782adc709644a5fe4b94f427c24757989023b (diff) | |
download | vala-80288cd79ea4d4554c624fda027b566d4fea46dd.tar.gz |
codegen: Update outdated array _size_ variable of captured local-variable
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1090
Diffstat (limited to 'tests/methods/parameter-ref-array-resize-captured.vala')
-rw-r--r-- | tests/methods/parameter-ref-array-resize-captured.vala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/methods/parameter-ref-array-resize-captured.vala b/tests/methods/parameter-ref-array-resize-captured.vala new file mode 100644 index 000000000..19fd6390b --- /dev/null +++ b/tests/methods/parameter-ref-array-resize-captured.vala @@ -0,0 +1,18 @@ +delegate void FooFunc (); + +void foo (ref int[] a) { + a = new int[1]; +} + +void main() { + int[] a = new int[10 * 1024 * 1024]; + + FooFunc func = () => { + foo (ref a); + }; + func (); + + for (int i = 1; i < 10 * 1024 * 1024; i++) { + a += 4711; + } +} |