Commit d0b18e2
go/analysis/passes/copylock: fix infinite recursion
Generalize the 'seenTParams' map to short-circuit all forms of infinite
recursion in the lockPath function, not just through type parameters.
For invalid code, it is possible to have infinite recursion through
named types.
Fixes golang/go#61678
Change-Id: I59d39c6fcaf3dd8bbd4f989516e2fb373b277889
Reviewed-on: https://go-review.googlesource.com/c/tools/+/514818
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>1 parent 5b4d426 commit d0b18e2
File tree
2 files changed
+40
-16
lines changed- go/analysis/passes/copylock
- testdata/src/a
2 files changed
+40
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
249 | 248 | | |
250 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
251 | 254 | | |
252 | 255 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | 256 | | |
263 | 257 | | |
264 | 258 | | |
265 | 259 | | |
266 | 260 | | |
267 | | - | |
| 261 | + | |
268 | 262 | | |
269 | 263 | | |
270 | 264 | | |
| |||
298 | 292 | | |
299 | 293 | | |
300 | 294 | | |
301 | | - | |
| 295 | + | |
302 | 296 | | |
303 | 297 | | |
304 | 298 | | |
| |||
332 | 326 | | |
333 | 327 | | |
334 | 328 | | |
335 | | - | |
| 329 | + | |
336 | 330 | | |
337 | 331 | | |
338 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments