[jit] Fix some alignment issues in mono_unwind_ops_encode_full ().
authorZoltan Varga <vargaz@gmail.com>
Fri, 15 Jul 2016 16:43:28 +0000 (12:43 -0400)
committerZoltan Varga <vargaz@gmail.com>
Fri, 15 Jul 2016 16:43:28 +0000 (12:43 -0400)
mono/mini/unwind.c

index ef3c65a7f225790813dfa5ab71f9a5e11b8c8ed4..a2824292404979c4f6e76691edaf2ce99a723575 100644 (file)
@@ -375,13 +375,15 @@ mono_unwind_ops_encode_full (GSList *unwind_ops, guint32 *out_len, gboolean enab
                while (op->when > loc) {
                        if (op->when - loc > 65536) {
                                *p ++ = DW_CFA_advance_loc4;
-                               *(guint32*)p = (guint32)(op->when - loc);
+                               guint32 v = (guint32)(op->when - loc);
+                               memcpy (p, &v, 4);
                                g_assert (read32 (p) == (guint32)(op->when - loc));
                                p += 4;
                                loc = op->when;
                        } else if (op->when - loc > 256) {
                                *p ++ = DW_CFA_advance_loc2;
-                               *(guint16*)p = (guint16)(op->when - loc);
+                               guint16 v = (guint16)(op->when - loc);
+                               memcpy (p, &v, 2);
                                g_assert (read16 (p) == (guint32)(op->when - loc));
                                p += 2;
                                loc = op->when;