From 494c245b591cef1a34cc4d4dc52163861d4e54af Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 30 Oct 2022 16:34:01 +0100 Subject: [DYNAREC] Reprotect bridge when emu is running --- src/tools/bridge.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/bridge.c b/src/tools/bridge.c index f30c5360..5da522ec 100755 --- a/src/tools/bridge.c +++ b/src/tools/bridge.c @@ -135,7 +135,11 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* khint_t k = kh_put(bridgemap, bridge->bridgemap, (uintptr_t)fnc, &ret); kh_value(bridge->bridgemap, k) = (uintptr_t)&b->b[sz].CC; pthread_mutex_unlock(&my_context->mutex_bridge); - // no need to reprotect the block, it will be protected later if needed + #ifdef DYNAREC + // only reprotect the block when stuffs are running + if(!my_context->deferedInit) + protectDB((uintptr_t)b->b, NBRICK*sizeof(onebridge_t)); + #endif #ifdef HAVE_TRACE if(name) addBridgeName(fnc, name); -- cgit 1.4.1