Просмотр исходного кода

Allow storing managed pointers into 'native int' in the JIT, fsharp generates code without a conv.i. Fixes #688008.

Zoltan Varga 14 лет назад
Родитель
Сommit
175d82693b
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      mono/mini/method-to-ir.c

+ 5 - 1
mono/mini/method-to-ir.c

@@ -1935,7 +1935,11 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg)
 	case MONO_TYPE_I:
 	case MONO_TYPE_U:
 	case MONO_TYPE_FNPTR:
-		if (arg->type != STACK_I4 && arg->type != STACK_PTR)
+		/* 
+		 * Some opcodes like ldloca returns 'transient pointers' which can be stored in
+		 * in native int. (#688008).
+		 */
+		if (arg->type != STACK_I4 && arg->type != STACK_PTR && arg->type != STACK_MP)
 			return 1;
 		return 0;
 	case MONO_TYPE_CLASS: