From a85993ff69d5ba9a2cf07b0d1889b3ddf2e099e5 Mon Sep 17 00:00:00 2001 From: Tom Lee Date: Sat, 25 May 2013 11:09:33 -0700 Subject: [PATCH] Added _RUST_STAGEN guard to rust_call_tydesc_glue --- src/rt/rust_builtin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index cf7c07770570..f173fa836a5a 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!