Skip to content

Commit

Permalink
* dis-cil.c (disassemble_cil): Exception clauses can be unordered,
Browse files Browse the repository at this point in the history
handle that.

svn path=/trunk/mono/; revision=60708


Commit migrated from mono/mono@eac5373
  • Loading branch information
radical committed May 15, 2006
1 parent 4e5cd23 commit 211f4be
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/mono/mono/dis/dis-cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
const unsigned char *ptr = start;
const MonoOpcode *entry;
char indent[1024];
int i, indent_level = 0;
int i, j, indent_level = 0;
gboolean in_fault = 0;
const char *clause_names[] = {"catch", "filter", "finally", "", "fault"};
gboolean *trys = NULL;
Expand All @@ -82,11 +82,16 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
trys = g_malloc0 (sizeof (gboolean) * mh->num_clauses);
trys [0] = 1;
for (i=1; i < mh->num_clauses; ++i) {
#define pcl mh->clauses [i-1]
#define jcl mh->clauses [j]
#define cl mh->clauses [i]
if (pcl.try_offset != cl.try_offset || pcl.try_len != cl.try_len)
trys [i] = 1;
#undef pcl
trys [i] = 1;
for (j = 0; j < i; j++) {
if (cl.try_offset == jcl.try_offset && cl.try_len == jcl.try_len) {
trys [i] = 0;
break;
}
}
#undef jcl
#undef cl
}
}
Expand Down

0 comments on commit 211f4be

Please sign in to comment.