about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/bridge.c6
1 files changed, 5 insertions, 1 deletions
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);