Skip to content

Commit

Permalink
minor cleanups to narrow scope of variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
braddr committed Jul 13, 2011
1 parent 3d172b8 commit d566d4b
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions src/eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,34 +316,29 @@ void except_fillInEHTable(symbol *s)
// Generate catch[]
for (block *b = startblock; b; b = b->Bnext)
{
if (b->BC == BC_try)
{ block *bhandler;
int nsucc;

if (b->jcatchvar) // if try-catch
{ list_t bl;

nsucc = list_nitems(b->Bsucc);
pdt = dtsize_t(pdt,nsucc - 1); // # of catch blocks
sz += NPTRSIZE;
if (b->BC == BC_try && b->jcatchvar) // if try-catch
{
int nsucc = list_nitems(b->Bsucc);
pdt = dtsize_t(pdt,nsucc - 1); // # of catch blocks
sz += NPTRSIZE;

for (bl = list_next(b->Bsucc); bl; bl = list_next(bl))
{
block *bcatch = list_block(bl);
for (list_t bl = list_next(b->Bsucc); bl; bl = list_next(bl))
{
block *bcatch = list_block(bl);

pdt = dtxoff(pdt,bcatch->Bcatchtype,0,TYjhandle);
pdt = dtxoff(pdt,bcatch->Bcatchtype,0,TYjhandle);

pdt = dtsize_t(pdt,cod3_bpoffset(b->jcatchvar)); // EBP offset
pdt = dtsize_t(pdt,cod3_bpoffset(b->jcatchvar)); // EBP offset

#if OUREH
pdt = dtxoff(pdt,funcsym_p,bcatch->Boffset - startblock->Boffset, TYnptr); // catch handler address
pdt = dtxoff(pdt,funcsym_p,bcatch->Boffset - startblock->Boffset, TYnptr); // catch handler address
#else
pdt = dtcoff(pdt,bcatch->Boffset); // catch handler address
pdt = dtcoff(pdt,bcatch->Boffset); // catch handler address
#endif
sz += 3 * NPTRSIZE;
}
sz += 3 * NPTRSIZE;
}
}
}
assert(sz != 0);
}

0 comments on commit d566d4b

Please sign in to comment.