Ver Fonte

Increase stack size on Windows to 8MB

Both Mac and Linux already use a 8MB stack by default. The 1MB stack on
Windows gives stack overflow problems on the debug build.

Signed-off-by: Sean Young <sean@mess.org>
Sean Young há 4 anos atrás
pai
commit
f6bfb0177c

+ 5 - 1
build.rs

@@ -46,11 +46,15 @@ fn main() {
         println!("cargo:rustc-link-lib=static={}", lib);
     }
 
-    // note: add error checking yourself.
     let output = Command::new("git")
         .args(&["describe", "--tags"])
         .output()
         .unwrap();
     let git_hash = String::from_utf8(output.stdout).unwrap();
     println!("cargo:rustc-env=GIT_HASH={}", git_hash);
+
+    // Make sure we have an 8MiB stack on Windows. Windows defaults to a 1MB
+    // stack, which is not big enough for debug builds
+    #[cfg(windows)]
+    println!("cargo:rustc-link-arg=/STACK:8388608");
 }

+ 2 - 2
tests/codegen_testcases/common_subexpression_elimination.sol

@@ -1,4 +1,4 @@
-// RUN: --target substrate --emit cfg --no-strength-reduce
+// RUN: --target substrate --emit cfg
 
 // Tests control commands
 contract c1 {
@@ -526,4 +526,4 @@ contract c1 {
         return k/a + int(uint(a)**uint(g));
     }
 
-}
+}