Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VariableSlot.getLocation() is nullable #383

Open
zcai1 opened this issue Feb 9, 2022 · 0 comments
Open

VariableSlot.getLocation() is nullable #383

zcai1 opened this issue Feb 9, 2022 · 0 comments

Comments

@zcai1
Copy link

zcai1 commented Feb 9, 2022

Currently, some variable slots don't have any location information (i.e., getLocation() returns null). For example, CombVariableSlot are instanciated with location equals to null in:

@Override
public CombVariableSlot createCombVariableSlot(Slot receiver, Slot declared) {
    CombVariableSlot combVariableSlot;
    Pair<Slot, Slot> pair = new Pair<>(receiver, declared);
    if (combSlotPairCache.containsKey(pair)) {
        int id = combSlotPairCache.get(pair);
        combVariableSlot = (CombVariableSlot) getSlot(id);
    } else {
        combVariableSlot = new CombVariableSlot(nextId(), null, receiver, declared);
        addToSlots(combVariableSlot);
        combSlotPairCache.put(pair, combVariableSlot.getId());
    }
    return combVariableSlot;
}

Another example is LubVariableSlot, which has a similar instanciation strategy in createMergeVariableSlot. Also, we may need special handling for the join of two branches (e.g., point to the if statement).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant