NaCl runtime fixes
[mono.git] / mono / mini / mini.c
index 8801957181b6b68963285bae89326dcacbff46e4..8357ca931c9561964147c62144c4ee5a39099f81 100644 (file)
@@ -5798,8 +5798,15 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                        patch_info.data.method = method;
                        g_hash_table_remove (domain_jit_info (target_domain)->jump_target_hash, method);
 
+#if defined(__native_client_codegen__) && defined(__native_client__)
+                       /* These patches are applied after a method has been installed, no target munging is needed. */
+                       nacl_allow_target_modification (FALSE);
+#endif
                        for (tmp = jlist->list; tmp; tmp = tmp->next)
                                mono_arch_patch_code (NULL, target_domain, tmp->data, &patch_info, NULL, TRUE);
+#if defined(__native_client_codegen__) && defined(__native_client__)
+                       nacl_allow_target_modification (TRUE);
+#endif
                }
        }