about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-05 17:20:59 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-05 17:20:59 -0800
commita731f165df26cb7575133d549ffd2f548bb3de99 (patch)
tree1576ba5f9bbbb493b45a3ac0a72ff5980fa5faf8 /src/rt
parent3b8bfaf5343dd13839df465cde6a4df50136ff03 (diff)
downloadrust-a731f165df26cb7575133d549ffd2f548bb3de99.tar.gz
rust-a731f165df26cb7575133d549ffd2f548bb3de99.zip
test: Test hitting the dynamic linker in the red zone
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp6
-rw-r--r--src/rt/rust_upcall.cpp6
-rw-r--r--src/rt/rustrt.def.in1
3 files changed, 10 insertions, 3 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 41c8bc68d2b..dd5831c2917 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -273,6 +273,12 @@ debug_ptrcast(type_desc *from_ty,
     return ptr;
 }
 
+extern "C" CDECL void *
+debug_get_stk_seg() {
+    rust_task *task = rust_scheduler::get_task();
+    return task->stk;
+}
+
 extern "C" CDECL rust_vec*
 rust_list_files(rust_str *path) {
     rust_task *task = rust_scheduler::get_task();
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 670dbc3a24a..f202cd1fd67 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -222,7 +222,7 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
     // FIXME (1226) - The shim functions generated by rustc contain the
     // morestack prologue, so we need to let them know they have enough
     // stack.
-    //record_sp(0);
+    record_sp(0);
 
     rust_scheduler *sched = task->sched;
     try {
@@ -232,8 +232,8 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
         //task->record_stack_limit();
         throw;
     }
-    //task = rust_scheduler::get_task();
-    //task->record_stack_limit();
+    task = rust_scheduler::get_task();
+    task->record_stack_limit();
 }
 
 struct rust_new_stack2_args {
diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in
index de9079800e2..ba1a9c1403d 100644
--- a/src/rt/rustrt.def.in
+++ b/src/rt/rustrt.def.in
@@ -8,6 +8,7 @@ del_port
 debug_ptrcast
 debug_tag
 debug_tydesc
+debug_get_stk_seg
 do_gc
 drop_task
 get_port_id