2010-05-31 Zoltan Varga <vargaz@gmail.com>
+ * unwind.c (mono_unwind_decode_fde): The FDE only has an augmention if the CIE
+ says so.
+
+ * aot-runtime.c (decode_eh_frame): Fix an assert condition.
+
* aot-compiler.c (patch_to_string): New debugging helper function.
2010-05-30 Zoltan Varga <vargaz@gmail.com>
}
g_assert (code >= amodule->eh_frame_hdr + table [(pos * 2)]);
- if (pos < fde_count)
+ if (pos + 1 < fde_count)
g_assert (code < amodule->eh_frame_hdr + table [(pos * 2) + 2]);
eh_frame = amodule->eh_frame_hdr + table [(pos * 2) + 1];
gint32 i, cie_aug_len, buf_len;
char *cie_aug_str;
guint8 *buf;
+ gboolean has_fde_augmentation = FALSE;
/*
* http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
g_assert (!strcmp (cie_aug_str, "zR") || !strcmp (cie_aug_str, "zPLR"));
+ has_fde_augmentation = TRUE;
+
/* Check that the augmention is what we expect */
if (!strcmp (cie_aug_str, "zPLR")) {
guint8 *cie_aug = p;
p += 4;
pc_range = *(guint32*)p;
p += 4;
- aug_len = decode_uleb128 (p, &p);
- fde_aug = p;
- p += aug_len;
+ if (has_fde_augmentation) {
+ aug_len = decode_uleb128 (p, &p);
+ fde_aug = p;
+ p += aug_len;
+ } else {
+ aug_len = 0;
+ }
fde_cfi = p;
fde_data_len = fde + 4 + fde_len - p;