File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -872,6 +872,14 @@ fn link_natively(
872
872
// is not a Microsoft LNK error then suggest a way to fix or
873
873
// install the Visual Studio build tools.
874
874
if let Some ( code) = prog. status . code ( ) {
875
+
876
+ // 0xc0000409 (`STATUS_STACK_BUFFER_OVERRUN`) is also used by `abort()` via `__fastfail` on Windows. Not necessarily a buffer overrun.
877
+ // See <https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655>
878
+ const STATUS_STACK_BUFFER_OVERRUN : i32 = 0xC0000409u32 as i32 ; // = -1073740791
879
+ if code == STATUS_STACK_BUFFER_OVERRUN {
880
+ sess. dcx ( ) . emit_note ( errors:: LinkExeFastFailAbort ) ;
881
+ }
882
+
875
883
// All Microsoft `link.exe` linking ror codes are
876
884
// four digit numbers in the range 1000 to 9999 inclusive
877
885
if is_msvc_link_exe && ( code < 1000 || code > 9999 ) {
@@ -881,13 +889,6 @@ fn link_natively(
881
889
882
890
sess. dcx ( ) . emit_note ( errors:: LinkExeUnexpectedError ) ;
883
891
884
- // 0xc0000409 (`STATUS_STACK_BUFFER_OVERRUN`) is also used by `abort()` via `__fastfail`. Not necessarily a buffer overrun.
885
- // See <https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655>
886
- const STATUS_STACK_BUFFER_OVERRUN : i32 = 0xC0000409u32 as i32 ; // = -1073740791
887
- if code == STATUS_STACK_BUFFER_OVERRUN {
888
- sess. dcx ( ) . emit_note ( errors:: LinkExeFastFailAbort ) ;
889
- }
890
-
891
892
if is_vs_installed && has_linker {
892
893
// the linker is broken
893
894
sess. dcx ( ) . emit_note ( errors:: RepairVSBuildTools ) ;
You can’t perform that action at this time.
0 commit comments