diff options
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r-- | erts/emulator/beam/beam_emu.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index e8a0c666e3..6741afc1b7 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -919,7 +919,11 @@ static void install_bifs(void) { ep->addressv[j] = ep->trampoline.raw; } - bif_export[i] = ep; + /* Set up a hidden export entry so we can trap to this BIF without + * it being seen when tracing. */ + erts_init_trap_export(&bif_trap_export[i], + entry->module, entry->name, entry->arity, + entry->f); } } @@ -1212,7 +1216,7 @@ ubif2mfa(void* uf) int i; for (i = 0; erts_u_bifs[i].bif; i++) { if (erts_u_bifs[i].bif == uf) - return &bif_export[erts_u_bifs[i].exp_ix]->info.mfa; + return &bif_trap_export[erts_u_bifs[i].exp_ix].info.mfa; } erts_exit(ERTS_ERROR_EXIT, "bad u bif: %p\n", uf); return NULL; @@ -2012,10 +2016,10 @@ apply_bif_error_adjustment(Process *p, Export *ep, * from the instructions i_apply_only, i_apply_last_P, * and apply_last_IP. */ - if (!(I && (ep == bif_export[BIF_error_1] || - ep == bif_export[BIF_error_2] || - ep == bif_export[BIF_exit_1] || - ep == bif_export[BIF_throw_1]))) { + if (!(I && (ep->bif_table_index == BIF_error_1 || + ep->bif_table_index == BIF_error_2 || + ep->bif_table_index == BIF_exit_1 || + ep->bif_table_index == BIF_throw_1))) { return; } @@ -2304,7 +2308,7 @@ erts_hibernate(Process* c_p, Eterm* reg) ASSERT(!ERTS_PROC_IS_EXITING(c_p)); } erts_proc_unlock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS); - c_p->current = &bif_export[BIF_hibernate_3]->info.mfa; + c_p->current = &bif_trap_export[BIF_hibernate_3].info.mfa; c_p->flags |= F_HIBERNATE_SCHED; /* Needed also when woken! */ return 1; } |