Debian Codegraph @

src/test/01-Basic/98.ck

raw
1 // this is a test of cleaning up multi-dim local array objects
2 fun void test()
3 {
4 [ [1,2,3], [1,2,3] ] @=> int x[][];
5 }
6
7 // call once; upon exiting, this should clean up x[][], including
8 // the two one-dimensional arrays contained within
9 test();
10
11 // if things go well, this should also work
12 test();
13
14 // hopefully we get here!
15 <<< "success" >>>;
16
17 // 1.4.1.2 (ge) | added fall 2022
18 // based on bug report by Terry F.
19 //
20 // Hi Ge,
21 //
22 // I was working on 256A this week when I found this interesting bug
23 // that causes miniAudicle to crash. Took a look at it with Nick this
24 // afternoon and found out that it crashes on Mac (M1) but Windows,
25 // seems to be fine. Not sure how it is on other systems but thought
26 // I'd share this.
27 //
28 // Code to reproduce:
29 //
30 // fun void test()
31 // {
32 // [ [1,2,3], [1,2,3] ] @=> int arr[][];
33 // 1::second => now;
34 // }
35 //
36 // test();
37 // test();
38 //
39 // Output:
40 //
41 // If running in terminal:
42 // Assertion failed: (FALSE), function execute, file chuck_instr.cpp, line 5166.
43 // zsh: abort chuck test.ck
44 //
45 // If running in miniAudicle, it'll just crash.