Skip to content

Commit

Permalink
disasm: Remove extra annotations
Browse files Browse the repository at this point in the history
Since we check annotations before updating the current sub
(since the sub needs to add all the active annotations anyway),
remove useless annotations from the end of the old sub.
  • Loading branch information
Benabik committed Jun 27, 2012
1 parent 394337d commit b3a2d36
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/disasm.winxed
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,19 @@ function read_packfile(var packfile) {
// XXX: Doesn't handle overlapping subs
// But that's okay right now, nobody generates them
if (sub_i < subs_size && subs[sub_i].start_offs() == pc) {
// TODO: Pop off unneeded annotations and debugs?
// Pop off unneeded annotations and debugs?
for(i = elements(sub.ops) - 1; i >= 0; --i) {
// XXX: Is there a better way to do this comparison?
switch (typeof(sub.ops[i])) {
case 'PACT;Packfile;Annotation':
case 'PACT;Packfile;Debug':
delete sub.ops[i];
break;
default:
i = 0;
break;
}
}

sub = subs[sub_i++];
sub_end = sub.end_offs();
Expand Down

0 comments on commit b3a2d36

Please sign in to comment.