Skip to content

Commit

Permalink
Fix locking on mem in cpu_step
Browse files Browse the repository at this point in the history
This caused hangs out of nowhere in ptraceomatic
  • Loading branch information
tbodt committed May 25, 2020
1 parent 8fe82fb commit 19a65a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jit/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ int cpu_step32(struct cpu_state *cpu, struct tlb *tlb) {

struct jit_block *block = state.block;
struct jit_frame frame = {.cpu = *cpu};
read_wrlock(&cpu->mem->lock);
int interrupt = jit_enter(block, &frame, tlb);
read_wrunlock(&cpu->mem->lock);
*cpu = frame.cpu;
jit_block_free(NULL, block);
return interrupt;
Expand Down

0 comments on commit 19a65a7

Please sign in to comment.