about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorTom Lee <github@tomlee.co>2013-05-25 11:09:33 -0700
committerTom Lee <github@tomlee.co>2013-05-27 17:13:01 -0700
commita85993ff69d5ba9a2cf07b0d1889b3ddf2e099e5 (patch)
tree8bb2a10b7a5169aecbd917b31669e54a3a8c828f /src/rt/rust_builtin.cpp
parentcddd274e4defa86820a7a4218f6f55a440b2f82f (diff)
downloadrust-a85993ff69d5ba9a2cf07b0d1889b3ddf2e099e5.tar.gz
rust-a85993ff69d5ba9a2cf07b0d1889b3ddf2e099e5.zip
Added _RUST_STAGEN guard to rust_call_tydesc_glue
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index cf7c0777057..f173fa836a5 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -731,10 +731,17 @@ rust_task_deref(rust_task *task) {
 // Must call on rust stack.
 extern "C" CDECL void
 rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
+#ifdef _RUST_STAGE0
+    void (*glue_fn)(void *, void *, void *, void *) =
+        (void (*)(void *, void *, void *, void *))tydesc[glue_index];
+    if (glue_fn)
+        glue_fn(0, 0, 0, root);
+#else
     void (*glue_fn)(void *, void *, void *) =
         (void (*)(void *, void *, void *))tydesc[glue_index];
     if (glue_fn)
         glue_fn(0, 0, root);
+#endif
 }
 
 // Don't run on the Rust stack!