about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-04-09 15:26:41 -0700
committerBrian Anderson <banderson@mozilla.com>2012-04-09 15:36:45 -0700
commitb42c6d07dc4b1aeb66901bd29b14ab34f9ef1183 (patch)
treeacf54093208bf0baa1c48ef1ee7aafb91f933ff7 /src/rt/rust_task.cpp
parenta1d59704ed12282e7f00c137e03538bc397fc8e3 (diff)
downloadrust-b42c6d07dc4b1aeb66901bd29b14ab34f9ef1183.tar.gz
rust-b42c6d07dc4b1aeb66901bd29b14ab34f9ef1183.zip
rt: Don't limit the amount of stack available during unwinding. Closes #2144
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index e1bc74e53df..b0ced523390 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -514,7 +514,17 @@ rust_task::new_stack(size_t requested_sz) {
 
     if (total_stack_sz + rust_stk_sz > kernel->env->max_stack_size) {
         LOG_ERR(this, task, "task %" PRIxPTR " ran out of stack", this);
-        fail();
+        if (!unwinding) {
+            fail();
+        } else {
+            // FIXME: Because we have landing pads that may need more
+            // stack than normally allowed we have to go allow the stack
+            // to grow unbounded during unwinding. Would be nice to
+            // have a different solution - maybe just double the limit.
+            LOG_ERR(this, task, "task %" PRIxPTR " has blown its stack "
+                    "budget but we are unwinding so growing the stack "
+                    "anyway");
+        }
     }
 
     size_t sz = rust_stk_sz + RED_ZONE_SIZE;