Skip to content

Commit

Permalink
fix FreeBSD x64 segfault context
Browse files Browse the repository at this point in the history
Issue #1401
  • Loading branch information
flyinghead committed Feb 27, 2024
1 parent 40a7c08 commit d6ae47d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/linux/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d6ae47d

Please sign in to comment.