Skip to content

Commit 7ef1be8

Browse files
committed
For macOS arm64 setting the default to jit write protect
Fixes native-to-managed callback fails with Apple Silicon (case 1305211) When Mono is embedded and we leave a runtime method invoke we leave the thread in a default state. Prior to this commit the default was to set the thread to jit write mode which disables jit exec for the thread. If the thread calls a native-to-managed callback we abort beacause of the exec protection. This change sets the default to write disabled and execute enabled. The thread will now be in a executable state for any potential callbacks coming from native.
1 parent 3eba83e commit 7ef1be8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mono/mini/mini-arm64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ static void mono_arm_restore_jit_protect_mode(jit_protect_mode* previous_jit_pro
216216
switch (*previous_jit_protect_mode)
217217
{
218218
case JPM_ENABLED:
219+
case JPM_NONE:
219220
mono_arm_jit_write_protect_enable();
220221
break;
221222
case JPM_DISABLED:
222-
case JPM_NONE:
223223
default:
224224
mono_arm_jit_write_protect_disable();
225225
}

0 commit comments

Comments
 (0)