Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.InvalidBytecodeException


        ConstantPoolGen cpg = getCPG();
        TypeFrame frame = getFrame();

        int numWordsConsumed = ins.consumeStack(cpg);
        if (numWordsConsumed == Constants.UNPREDICTABLE) {
            throw new InvalidBytecodeException("Unpredictable stack consumption for " + ins);
        }
        if (numWordsConsumed > frame.getStackDepth()) {
            throw new InvalidBytecodeException("Stack underflow for " + ins + ", " + numWordsConsumed + " needed, " + frame.getStackDepth() + " avail, frame is " + frame);
        }
        try {
            while (numWordsConsumed-- > 0) {
                frame.popValue();
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException("Stack underflow for " + ins + ": " + e.getMessage());
        }
    }
View Full Code Here


     */
    @Override
    public void modelNormalInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced) {
        if (VERIFY_INTEGRITY) {
            if (numWordsProduced > 0) {
                throw new InvalidBytecodeException("missing visitor method for " + ins);
            }
        }
        super.modelNormalInstruction(ins, numWordsConsumed, numWordsProduced);
    }
View Full Code Here

            } else {
                super.handleStoreInstruction(obj);
            }

        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException(
                    "error handling store instruction ", e);
        }
    }
View Full Code Here

     */
    @Override
    public void handleLoadInstruction(LoadInstruction obj) {
        int numProduced = obj.produceStack(cpg);
        if (numProduced == Constants.UNPREDICTABLE) {
            throw new InvalidBytecodeException("Unpredictable stack production");
        }

        if (numProduced != 1) {
            super.handleLoadInstruction(obj);
            return;
View Full Code Here

                pushValue(t);
            } else {
                pushValue(obj.getType(getCPG()));
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException("Stack underflow for " + obj + ": " + e.getMessage());
        }
    }
View Full Code Here

            frame.pushValue(value);
            if (isExact) {
                setTopOfStackIsExact();
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException(e.toString());
        }
    }
View Full Code Here

                pushValue(arr.getElementType());
            } else {
                pushValue(TypeFrame.getBottomType());
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException("Stack underflow: " + e.getMessage());
        }
    }
View Full Code Here

    private void checkConsumedAndProducedValues(Instruction ins, ValueNumber[] consumedValueList, ValueNumber[] producedValueList) {
        int numConsumed = ins.consumeStack(getCPG());
        int numProduced = ins.produceStack(getCPG());

        if (numConsumed == Constants.UNPREDICTABLE) {
            throw new InvalidBytecodeException("Unpredictable stack consumption for " + ins);
        }
        if (numProduced == Constants.UNPREDICTABLE) {
            throw new InvalidBytecodeException("Unpredictable stack production for " + ins);
        }

        if (consumedValueList.length != numConsumed) {
            throw new IllegalStateException("Wrong number of values consumed for " + ins + ": expected " + numConsumed + ", got "
                    + consumedValueList.length);
View Full Code Here

                        }
                        frame.pushValue(factory.getClassObjectValue(className));
                        return;
                    }
                } catch (DataflowAnalysisException e) {
                    throw new InvalidBytecodeException("stack underflow", methodGen, handle, e);
                }
            } else if (Hierarchy.isInnerClassAccess(obj, cpg)) {
                // Possible access of field via an inner-class access method
                XField xfield = loadedFieldSet.getField(handle);
                if (xfield != null) {
View Full Code Here

            frame.getTopStackWords(inputValueList);
            while (numWordsConsumed-- > 0) {
                frame.popValue();
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException("Error getting input operands", e);
        }

        return inputValueList;
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.InvalidBytecodeException

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.