about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-02-10 11:29:47 -0800
committerGraydon Hoare <graydon@mozilla.com>2011-02-10 11:29:47 -0800
commitc4a56f7368404265a1189d3f3202f4dedfd5d0f1 (patch)
tree46c9048bdb5bb6b0dd0fa3f0186ff4a63b5d9978
parentb7dfbc9db079a6c55d9e716d295f87597752b668 (diff)
downloadrust-c4a56f7368404265a1189d3f3202f4dedfd5d0f1.tar.gz
rust-c4a56f7368404265a1189d3f3202f4dedfd5d0f1.zip
Commit the trap-failure hack to the runtime, since I keep using it in my workspace anyways.
-rw-r--r--src/rt/rust_upcall.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 7e2fac101ed..46e53048899 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -253,6 +253,10 @@ upcall_fail(rust_task *task,
     task->log(rust_log::UPCALL | rust_log::ERR,
               "upcall fail '%s', %s:%" PRIdPTR, expr, file, line);
     task->fail(4);
+    if (getenv("RUST_TRAP_FAILURE")) {
+        // FIXME: x86-ism.
+        __asm__("int3");
+    }
 }
 
 /**