Skip to content

Commit d7fff9f

Browse files
author
Keegan McAllister
committed
Add -C no-stack-check
Fixes #16980.
1 parent db3bd23 commit d7fff9f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustc/driver/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ cgoptions!(
390390
"divide crate into N units to optimize in parallel"),
391391
remark: Passes = (SomePasses(Vec::new()), parse_passes,
392392
"print remarks for these optimization passes (space separated, or \"all\")"),
393+
no_stack_check: bool = (false, parse_bool,
394+
"disable checks for stack exhaustion (a memory-safety hazard!)"),
393395
)
394396

395397
pub fn build_codegen_options(matches: &getopts::Matches) -> CodegenOptions

src/librustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
204204
// Function addresses in Rust are never significant, allowing functions to be merged.
205205
llvm::SetUnnamedAddr(llfn, true);
206206

207-
if ccx.is_split_stack_supported() {
207+
if ccx.is_split_stack_supported() && !ccx.sess().opts.cg.no_stack_check {
208208
set_split_stack(llfn);
209209
}
210210

0 commit comments

Comments
 (0)