Skip to content

Incorrect source value for Phase II(i) value computation #14

Open
@jtoman

Description

@jtoman

I believe I've run across a bug in the implementation of Phase II(i) in IDESolver. The problem seems arise when a fact besides the zero fact is used for an initial seeds.

The problem occurs in propagateValueAtStart:

private void propagateValueAtStart(Pair<N, D> nAndD, N n) {
    D d = nAndD.getO2();        
    M p = icfg.getMethodOf(n);
    for(N c: icfg.getCallsFromWithin(p)) {                  
        Set<Entry<D, EdgeFunction<V>>> entries; 
        synchronized (jumpFn) {
            entries = jumpFn.forwardLookup(d,c).entrySet();
            for(Map.Entry<D,EdgeFunction<V>> dPAndFP: entries) {
                D dPrime = dPAndFP.getKey();
                EdgeFunction<V> fPrime = dPAndFP.getValue();
                N sP = n;
                propagateValue(c,dPrime,fPrime.computeTarget(val(sP,d)));
            }
        }
    }
}

In this case, d is a non-zero fact that was an initial seed. The forwardLookup call returns that there are no destination (fact,function) pairs for the source fact d. This is because most (all?) jump functions have the zero fact as their source fact. The analysis seems to work if I explicitly replace the second element of the tuple passed to propagateValueAtStart with the zero fact, but this fix is a hack at best and I'm not sure if it is correct in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions