[aot] Fix the computation of LLVM code ranges.
authorZoltan Varga <vargaz@gmail.com>
Wed, 18 Feb 2015 23:24:44 +0000 (18:24 -0500)
committerZoltan Varga <vargaz@gmail.com>
Wed, 18 Feb 2015 23:24:49 +0000 (18:24 -0500)
mono/mini/aot-runtime.c

index 01deb31d4bcdfafce89c34541677bd53bc522582..87e0c532d55cc7d9404fa15d6c49349d06a38d5b 100644 (file)
@@ -2374,8 +2374,10 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c
        table = (gint32*)p;
 
        if (fde_count) {
-               *code_start = amodule->code + amodule->code_offsets [table [0]];
-               *code_end = *code_start + amodule->code_offsets [table [(fde_count - 1) * 2]] + table [fde_count * 2];
+               g_assert (fde_count != 1);
+               g_assert (table [0] == -1);
+               *code_start = amodule->code + amodule->code_offsets [table [2]];
+               *code_end = amodule->code + amodule->code_offsets [table [(fde_count - 1) * 2]] + table [fde_count * 2];
        }
 }