Commit 640a431
authored
Rollup merge of rust-lang#118464 - wesleywiser:fix_dispose_ordering, r=Nilstrieb
Dispose llvm::TargetMachines prior to llvm::Context being disposed
If the TargetMachine is disposed after the Context is disposed, it can lead to use after frees in some cases.
I've observed this happening occasionally on code compiled for aarch64-pc-windows-msvc using `-Zstack-protector=strong` but other users have reported AVs from host aarch64-pc-windows-msvc compilers as well.
I was not able to extract a self-contained test case yet so there is no accompanying test.
Fixes rust-lang#1184622 files changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
| 738 | + | |
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
410 | | - | |
411 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
422 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
429 | 435 | | |
430 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
431 | 441 | | |
432 | 442 | | |
433 | 443 | | |
| |||
448 | 458 | | |
449 | 459 | | |
450 | 460 | | |
451 | | - | |
| 461 | + | |
452 | 462 | | |
453 | 463 | | |
454 | 464 | | |
| |||
460 | 470 | | |
461 | 471 | | |
462 | 472 | | |
| 473 | + | |
463 | 474 | | |
464 | 475 | | |
465 | 476 | | |
| |||
0 commit comments