summaryrefslogtreecommitdiff
path: root/tests/methods/parameter-ref-array-resize-captured.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-10-22 21:22:15 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-10-22 21:23:16 +0200
commit80288cd79ea4d4554c624fda027b566d4fea46dd (patch)
tree28c727d858fca48b9a0aead565b3cd0256c30435 /tests/methods/parameter-ref-array-resize-captured.vala
parent3dc782adc709644a5fe4b94f427c24757989023b (diff)
downloadvala-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.vala18
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;
+ }
+}