Skip to content

Commit 50a5f5e

Browse files
author
Ariel Ben-Yehuda
committed
change wording for stack-protector-strong
1 parent 9c8e2df commit 50a5f5e

File tree

2 files changed

+9
-5
lines changed
  • compiler/rustc_codegen_llvm/src
  • src/doc/rustc/src/codegen-options

2 files changed

+9
-5
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,10 @@ impl CodegenBackend for LlvmCodegenBackend {
292292
293293
The exact rules are unstable and subject to change, but
294294
currently, it generates stack protectors for functions that,
295-
*post-optimization*, contain either arrays (of any size
296-
or type) or address-taken locals.
295+
*post-optimization*, contain LLVM allocas (which
296+
include all stack allocations - including fixed-size
297+
allocations - that are used in a way that is not completely
298+
determined by static control flow).
297299
298300
none
299301
Do not generate stack canaries.

src/doc/rustc/src/codegen-options/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,11 @@ Supported values for this option are:
714714

715715
The exact rules are unstable and subject to change, but
716716
currently, it generates stack protectors for functions that,
717-
*post-optimization*, contain either arrays (of any size
718-
or type) or address-taken locals.
719-
- `all`: Generate stack canaries in all functions
717+
*post-optimization*, contain LLVM allocas (which
718+
include all stack allocations - including fixed-size
719+
allocations - that are used in a way that is not completely
720+
determined by static control flow).
721+
- `all`: Generate stack canaries in all functions
720722

721723
Stack protectors are not supported on many GPU targets, use of stack
722724
protectors on these targets is an error.

0 commit comments

Comments
 (0)