[interp] fix unaligned.
[mono.git] / mono / mini / interp / transform.c
index 69ef2c13fb66d4d1096bd1342531cf1b54fafef2..fb2ef6b60c0e32a599846796fd10c3d74d9ab53e 100644 (file)
@@ -3237,8 +3237,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                ++td.ip;
                                break;
                        case CEE_UNALIGNED_:
-                               ++td.ip;
-                               /* FIX: should do something? */;
+                               td.ip += 2;
                                break;
                        case CEE_VOLATILE_:
                                ++td.ip;
@@ -3523,7 +3522,7 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                header = mono_method_get_header (nm);
                mono_os_mutex_unlock(&calc_section);
        } else if (method->klass == mono_defaults.array_class) {
-               if (!strcmp (method->name, "UnsafeMov")) {
+               if (!strcmp (method->name, "UnsafeMov") || !strcmp (method->name, "UnsafeLoad")) {
                        mono_os_mutex_lock (&calc_section);
                        if (!runtime_method->transformed) {
                                runtime_method->code = g_malloc (sizeof (short));
@@ -3535,9 +3534,7 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                        mono_os_mutex_unlock(&calc_section);
                        mono_profiler_method_end_jit (method, NULL, MONO_PROFILE_OK);
                        return NULL;
-               } else if (!strcmp (method->name, "UnsafeStore)")) {
-                       g_error ("TODO");
-               } else if (!strcmp (method->name, "UnsafeLoad)")) {
+               } else if (!strcmp (method->name, "UnsafeStore")) {
                        g_error ("TODO");
                }
        }