Skip to content

Commit a85993f

Browse files
committed
Added _RUST_STAGEN guard to rust_call_tydesc_glue
1 parent cddd274 commit a85993f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rt/rust_builtin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,17 @@ rust_task_deref(rust_task *task) {
731731
// Must call on rust stack.
732732
extern "C" CDECL void
733733
rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
734+
#ifdef _RUST_STAGE0
735+
void (*glue_fn)(void *, void *, void *, void *) =
736+
(void (*)(void *, void *, void *, void *))tydesc[glue_index];
737+
if (glue_fn)
738+
glue_fn(0, 0, 0, root);
739+
#else
734740
void (*glue_fn)(void *, void *, void *) =
735741
(void (*)(void *, void *, void *))tydesc[glue_index];
736742
if (glue_fn)
737743
glue_fn(0, 0, root);
744+
#endif
738745
}
739746

740747
// Don't run on the Rust stack!

0 commit comments

Comments
 (0)