private void fixup(Object bb) throws Exception {
        ArrayList<Integer> fixupLocations = fixup.get(bb);
        if(fixupLocations == null) {
            return;
        }
        int address = labels.get(bb);
        for(Integer i : fixupLocations) {
            int instruction = code.get(i);
            // determine relative branch address
            int c = address - i;
            instruction = setC(instruction, c);
            code.set(i, instruction); // replace instruction with the fixed up version
        }
        fixup.remove(bb);       // remove bb from the fixup locations
    }