[Soot-list] Immediate dominator of non-head nodes in a multi-headed CFG

Haipeng Cai hcai at nd.edu
Tue Aug 6 18:39:28 EDT 2013


Hi,

There is an assertion "assert immediateDominator!=null" in
soot.toolkits.graph.MHGDominatorFinder::getImmediateDominator, which I
don't understand and even doubt it could be a buggy assertion.

For an example as attached (in Jimple IR), the CFG has two exits (returns)
hence its inverse graph two entries (heads) - MHGPostDominatorFinder
simply is built upon MHGDominatorFinder by taking the inverse CFG. However,
unit node *s1* (blackened in the example below) won't have post-dominators
by definition, or it does not have dominators from within
MHGDominatorFinder. Also, it is not a head node either. Then, the immediate
dominator of it will be null. As a result, the assertion will fail with
this CFG when invoking *getImmediateDominator.*
*
*
In case I misunderstood something, can anyone help explain why this
assertion should actually be there, please? Or, it is really a bug?
Any advice is sincerely appreciated!

Thanks!

------------------------------------------------------------------- example
code ---------------------------------------------------------
 int M3(int, int)
    {
        B r0;
        int i0, i1, i2;
        boolean z0;
        double $d0;

        r0 := @this: B;
        i0 := @parameter0: int;
        i1 := @parameter1: int;
        r0.<B: double c> = 1.2;
        <B: float l> = -250.0F;
*s1:    if i0 <= i1 goto label0;*

        return 0;

     label0:
        z0 = 0;
        if i0 >= i1 goto label1;

        i2 = i1 - i0;
        goto label2;

     label1:
        $d0 = r0.<B: double c>;
        i2 = (int) $d0;

     label2:
        return i2;
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130806/248859b4/attachment.html 


More information about the Soot-list mailing list