fix FreeBSD x64 segfault context

Issue #1401
This commit is contained in:
Flyinghead 2024-02-26 11:27:03 +01:00
parent ff91d1101a
commit f629c352e1
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx)
#elif HOST_CPU == CPU_X64
#if defined(__FreeBSD__) || defined(__DragonFly__)
bicopy<ToSegfault>(hostctx->pc, MCTX(.mc_rip));
bicopy<ToSegfault>(hostctx->rsp, MCTX(.mc_rsp));
bicopy<ToSegfault>(hostctx->r9, MCTX(.mc_r9));
bicopy<ToSegfault>(hostctx->rdi, MCTX(.mc_rdi));
#elif defined(__OpenBSD__)
bicopy<ToSegfault>(hostctx->pc, MCTX(->sc_rip));
bicopy<ToSegfault>(hostctx->rsp, MCTX(->sc_rsp));