Commit 42fef1f
committed
SILGen: let withoutActuallyEscaping also catch an escaping closure in the throwing case
withoutActuallyEscaping checks that the passed closure has not beed escaped by ensuring that its reference count is exactly 1 at the end of the code block.
So far this was only done in the regular return case. But if the code block throws, the check was not done.
Fixes an undetected undefined behavior.1 parent 33eab01 commit 42fef1f
File tree
3 files changed
+59
-11
lines changed- lib/SILGen
- test
- Interpreter
- SILGen
3 files changed
+59
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6041 | 6041 | | |
6042 | 6042 | | |
6043 | 6043 | | |
| 6044 | + | |
| 6045 | + | |
| 6046 | + | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
| 6057 | + | |
| 6058 | + | |
| 6059 | + | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
6044 | 6072 | | |
6045 | 6073 | | |
6046 | 6074 | | |
| |||
6075 | 6103 | | |
6076 | 6104 | | |
6077 | 6105 | | |
6078 | | - | |
| 6106 | + | |
6079 | 6107 | | |
| 6108 | + | |
| 6109 | + | |
| 6110 | + | |
6080 | 6111 | | |
6081 | 6112 | | |
6082 | 6113 | | |
6083 | 6114 | | |
6084 | | - | |
6085 | | - | |
6086 | | - | |
6087 | | - | |
6088 | | - | |
6089 | | - | |
6090 | | - | |
6091 | 6115 | | |
6092 | 6116 | | |
6093 | 6117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
56 | | - | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
81 | 103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | 38 | | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
0 commit comments