Exemple #1
0
def explore_path(path):
    locks = []
    unlocks = []
    for e in path.effects:
        if isinstance(e, PathCall):
            if lock.is_lock(e.func):
                locks.append(e)
            if lock.is_unlock(e.func):
                unlocks.append(e)
        if len(locks) > 3 or len(unlocks) > 3:
            break
    return (locks, unlocks)
Exemple #2
0
def explore_path(path):
    locks = []
    unlocks = []
    for e in path.effects:
        if isinstance(e, PathCall):
            if lock.is_lock(e.func):
                locks.append(e)
            if lock.is_unlock(e.func):
                unlocks.append(e)
        if len(locks) > 3 or len(unlocks) > 3:
            break
    return (locks, unlocks)
Exemple #3
0
def explore_path(path, report):
    state = lock.LockState()
    for e in path.effects:
        if state.is_locked():
            state.add(e)

        if isinstance(e, PathCall):
            # like this
            #   extracted from results/lock-locked.log
            if "i_size_read" == e.func:
                dbg.bug_range("XXXX: %s (locked: %s)", str(e), state.is_locked())
                report.add("not protected", e.func, path, e.loc)
            if lock.is_lock(e.func):
                state.lock(e)
            elif lock.is_unlock(e.func):
                state.unlock(e)

    return state