hy keith,

let's have a look to your 'misterious point' example:

L0: call Before
L1: br COND
LOOP: call Body
COND: call Condition
L2: brtrue  LOOP
L3: call After


Here how my algorithm works (& I suppose the .Net does the same) :

Before L0 : 0
==> before L1 : C1 (where C1 is a constant depending on L0 instructions)

Before L1 : C1
==> Before COND : C1

before COND : C1
==> before L2 : C2 (C2 is another know constant)

before L2 : C2
==> before LOOP : C3 = C2 - 1  (Here, we have the actual stack depth
of your mysterious point !!!!!)
==> before L3 : C3 = C2 - 1

...etc.


So when we start, we suppose all the points are "mysterious points"
We mark the first instruction as non mysterious with stack depth = 0;
We mark the first instruction of every exception handling block as non
mysterious with stack depth = 0 or 1 (depending of the type of the
block);

then we should start by traversing NON-mysterious points first, and
from them we can know about stack depth of other points.

In case at a certain point, all remaining points are mysterious, than
we take the first one, and assume it has a stack depth of 0.

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to