Commit 865e8f0
committed
Fix initialization vulnerability in Scanner
When bootstrapping with -Yno-inline, Tokens failied to initialize
because the length `maxToken` in `tokenString` was still 0. Changing
a `val` to a `def` fixes that. This is a nice demonstration that the
initialization rules are non-intuitive - we get bitten by them ourselves!1 parent a84bcf5 commit 865e8f0
File tree
2 files changed
+3
-3
lines changed- compiler/src/dotty/tools/dotc/parsing
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments