From b60f75c9261e0968fbb6f3aa435660db189e0ab5 Mon Sep 17 00:00:00 2001 From: George Tokmaji Date: Sat, 31 May 2025 21:18:41 +0200 Subject: Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code `STATUS_STACK_BUFFER_OVERRUN` is also used for fast abnormal program termination, e.g. by abort(). Emit a special diagnostic to let people know that this most likely doesn't indicate a stack buffer overrun. --- compiler/rustc_codegen_ssa/src/errors.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_codegen_ssa/src/errors.rs') diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 3d787d8bdbd..9ef1473e538 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -550,6 +550,11 @@ impl Diagnostic<'_, G> for LinkingFailed<'_> { #[diag(codegen_ssa_link_exe_unexpected_error)] pub(crate) struct LinkExeUnexpectedError; +#[derive(Diagnostic)] +#[diag(codegen_ssa_link_exe_status_stack_buffer_overrun)] +#[note] +pub(crate) struct LinkExeStatusStackBufferOverrun; + #[derive(Diagnostic)] #[diag(codegen_ssa_repair_vs_build_tools)] pub(crate) struct RepairVSBuildTools; -- cgit 1.4.1-3-g733a5