]> git.lizzy.rs Git - rust.git/commitdiff
Add -C no-stack-check
authorKeegan McAllister <kmcallister@mozilla.com>
Sat, 6 Sep 2014 00:56:59 +0000 (17:56 -0700)
committerKeegan McAllister <kmcallister@mozilla.com>
Thu, 9 Oct 2014 21:32:23 +0000 (14:32 -0700)
Fixes #16980.

src/librustc/driver/config.rs
src/librustc/middle/trans/base.rs

index 9ce012502446dca7f8d9fcfe3bd6efd4daf0e3e4..17d1d565df4f8b424e451b98e14108b0abf81fba 100644 (file)
@@ -390,6 +390,8 @@ fn parse_passes(slot: &mut Passes, v: Option<&str>) -> bool {
         "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
index bfe66de12b1896270e99115e4f00ea4fb3dc29db..69fabaf7173ab34934418e420fd47f4267d3c2ad 100644 (file)
@@ -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);
     }