Package edu.umd.cs.findbugs.ba.vna

Examples of edu.umd.cs.findbugs.ba.vna.ValueNumber


        // The ValueNumberFrame *before* the FieldInstruction should
        // have the ValueNumber of the stored value on the top of the stack.
        ValueNumberFrame vnaFrameAtStore = vnaDataflow.getFactAtLocation(location);
        if (vnaFrameAtStore.isValid()) {
            ValueNumber vn = vnaFrameAtStore.getTopValue();
            SourceSinkInfo sink = new SourceSinkInfo(SourceSinkType.FIELD_STORE, location, vn, when);
            registerSourceSink(sink);
        }
    }
View Full Code Here


                }
            }

            When when = (tqa != null) ? tqa.when : When.UNKNOWN;

            ValueNumber vn = vnaFrame.getArgument(inv, cpg, param, sigParser);

            SourceSinkInfo info = new SourceSinkInfo(SourceSinkType.ARGUMENT_TO_CALLED_METHOD, location, vn, when);
            info.setParameter(param);
            info.setInterproc(interproc);
View Full Code Here

    }

    private void handleNullCheck(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact)
            throws DataflowAnalysisException {
        if (reportPotentialDereference(location, invDataflow.getFactAtLocation(location))) {
            ValueNumber vn = vnaFrame.getTopValue();
            fact.addDeref(vn, location);
        }
    }
View Full Code Here

        if (database.getResolvedAnnotation(thisMethod, true) != NullnessAnnotation.NONNULL) {
            return;
        }
        if (reportPotentialDereference(location, invDataflow.getFactAtLocation(location))) {
            ValueNumber vn = vnaFrame.getTopValue();
            fact.addDeref(vn, location);
        }
    }
View Full Code Here

            if (!invFrame.isValid()) {
                return;
            }
            IsNullValue value = invFrame.getTopValue();
            if (reportDereference(value)) {
                ValueNumber vn = vnaFrame.getTopValue();
                fact.addDeref(vn, location);
            }
        }
    }
View Full Code Here

                int catchSizeNFE = Util.getSizeOfSurroundingTryBlock(method, "java/lang/NumberFormatException", location
                        .getHandle().getPosition());
                if (catchSizeNPE == Integer.MAX_VALUE
                        && (!called.getClassName().equals("java.lang.Integer") || catchSizeNFE == Integer.MAX_VALUE)) {
                    // Get the corresponding value number
                    ValueNumber vn = vnaFrame.getArgument(inv, constantPool, i, sigParser);
                    result.add(vn);
                }
            }
        }
        return result;
View Full Code Here

        if (fallThroughPredecessor == null || !fallThroughPredecessor.isNullCheck()) {
            return;
        }

        // Get the null-checked value
        ValueNumber vn = vnaFrame.getInstance(location.getHandle().getInstruction(), methodGen.getConstantPool());

        // Ignore dereferences of this
        if (!methodGen.isStatic()) {
            ValueNumber v = vnaFrame.getValue(0);
            if (v.equals(vn)) {
                return;
            }
        }
        if (vn.hasFlag(ValueNumber.CONSTANT_CLASS_OBJECT)) {
            return;
View Full Code Here

                System.out.println("Skipping exception edge");
            }
            return;
        }

        ValueNumber knownNonnullOnBranch = null;
        // Edge transfer function
        if (isFactValid(fact)) {
            fact = propagateDerefSetsToMergeInputValues(fact, edge);
            if (invDataflow != null) {
                knownNonnullOnBranch = findValueKnownNonnullOnBranch(fact, edge);
View Full Code Here

                    System.out.println("** Block : " + blockValueNumberFrame);
                    System.out.println("** Target: " + targetValueNumberFrame);
                }

                for (int i = 0; i < slots; i++) {
                    ValueNumber blockVN = blockValueNumberFrame.getValue(i);
                    ValueNumber targetVN = targetValueNumberFrame.getValue(i);
                    if (blockVN.equals(targetVN)) {
                        continue;
                    }
                    fact.clearDerefSet(blockVN);
                    if (originalFact.isUnconditionallyDereferenced(targetVN)) {
                        fact.setDerefSet(blockVN, originalFact.getUnconditionalDerefLocationSet(targetVN));
                    }

                } // for all slots

                for (ValueNumber blockVN : blockValueNumberFrame.valueNumbersForLoads()) {
                    AvailableLoad load = blockValueNumberFrame.getLoad(blockVN);
                    if (load == null) {
                        continue;
                    }
                    ValueNumber[] targetVNs = targetValueNumberFrame.getAvailableLoad(load);
                    if (targetVNs != null) {
                        for (ValueNumber targetVN : targetVNs) {
                            if (targetVN.hasFlag(ValueNumber.PHI_NODE) && fact.isUnconditionallyDereferenced(targetVN)
                                    && !fact.isUnconditionallyDereferenced(blockVN)) {
                                // Block VN is also dereferenced
                                // unconditionally.
                                AvailableLoad targetLoad = targetValueNumberFrame.getLoad(targetVN);
                                if (!load.equals(targetLoad)) {
View Full Code Here

        IsNullValue inv = decision.getDecision(edge.getType());
        if (inv == null || !inv.isDefinitelyNotNull()) {
            return null;
        }
        ValueNumber value = decision.getValue();
        if (DEBUG) {
            System.out.println("Value number " + value + " is known nonnull on " + edge);
        }

        return value;
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.vna.ValueNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.