Issue: Safety violation
Shared Variables Output
Turn Thread Execution
 PC 
ibc$x seats
T0: __init__()
Set ibc$x to 0
Set seats to [ -1, -1 ]
T1: thread(0)
T2: thread(1)
Set ibc$x to 1
Set seats[1] to 0
T1: thread(0)
Set ibc$x to 2
Set seats[0] to 0
T3: finally()

Harmony bytecode

0  Frame __init__()
1  Sequential
2  Push 0
3  Store ibc$x
4  Jump 22
5  Frame book()
6  Load ibc$x
7  Push 4
8  2-ary ==
9  JumpCond False 14
10  Push 1
11  1-ary -
12  StoreVar seat
13  Jump 20
14  Load ibc$x
15  StoreVar seat
16  Load ibc$x
17  Push 1
18  2-ary +
19  Store ibc$x
20  ReturnOp(seat)
21  DelVar seat
22  Push ()
23  Push 1
24  1-ary -
25  2-ary ListAdd
26  Push 1
27  1-ary -
28  2-ary ListAdd
29  Store seats
30  Jump 40
31  Frame thread(tid)
32  Push ?seats
33  LoadVar tid
34  DelVar tid
35  2-ary AddArg
36  Push ()
37  Apply PC(5)
38  Store
39  ReturnOp(result. None)
40  Push ?PC(31)
41  Push 0
42  2-ary AddArg
43  Push {:}
44  Spawn
45  Push ?PC(31)
46  Push 1
47  2-ary AddArg
48  Push {:}
49  Spawn
50  Jump 70
51  Frame check()
52  Push ?seats
53  Push 0
54  2-ary AddArg
55  Load
56  Push ?seats
57  Push 1
58  2-ary AddArg
59  Load
60  2-ary !=
61  StoreVar res
62  ReturnOp(res)
63  DelVar res
64  Jump 70
65  Frame finally()
66  Push ()
67  Apply PC(51)
68  Assert
69  ReturnOp(result. None)
70  Finally 65
71  ReturnOp(result. None)
72  DelVar result
Threads
 ID   Status  Stack Trace  Stack Top 
T0 init
T1 init
T2 init
T3 init