Skip to content

Commit

Permalink
Add -C no-stack-check
Browse files Browse the repository at this point in the history
Fixes #16980.
  • Loading branch information
Keegan McAllister committed Oct 9, 2014
1 parent db3bd23 commit d7fff9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/librustc/driver/config.rs
Expand Up @@ -390,6 +390,8 @@ cgoptions!(
"divide crate into N units to optimize in parallel"),
remark: Passes = (SomePasses(Vec::new()), parse_passes,
"print remarks for these optimization passes (space separated, or \"all\")"),
no_stack_check: bool = (false, parse_bool,
"disable checks for stack exhaustion (a memory-safety hazard!)"),
)

pub fn build_codegen_options(matches: &getopts::Matches) -> CodegenOptions
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Expand Up @@ -204,7 +204,7 @@ pub fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
// Function addresses in Rust are never significant, allowing functions to be merged.
llvm::SetUnnamedAddr(llfn, true);

if ccx.is_split_stack_supported() {
if ccx.is_split_stack_supported() && !ccx.sess().opts.cg.no_stack_check {
set_split_stack(llfn);
}

Expand Down

0 comments on commit d7fff9f

Please sign in to comment.