@Override public void visit(Method obj) { state = SEEN_NOTHING; varTable = obj.getLocalVariableTable(); if (varTable != null) { super.visit(obj); } }
private void pushByLocalObjectLoad(DismantleBytecode dbc, int register) { Method m = dbc.getMethod(); LocalVariableTable lvt = m.getLocalVariableTable(); if (lvt != null) { LocalVariable lv = LVTHelper.getLocalVariableAtPC(lvt, register, dbc.getPC()); if (lv != null) { String signature = lv.getSignature(); pushByLocalLoad(signature, register); return; } } pushByLocalLoad("Ljava/lang/Object;", register); }
public static LocalVariableAnnotation getLocalVariableAnnotation(Method method, int local, int position1, int position2) { LocalVariableTable localVariableTable = method.getLocalVariableTable(); String localName = UNKNOWN_NAME; if (localVariableTable != null) { LocalVariable lv1 = localVariableTable.getLocalVariable(local, position1); if (lv1 == null) { lv1 = localVariableTable.getLocalVariable(local, position2); position1 = position2; } if (lv1 != null) { localName = lv1.getName(); } } LineNumberTable lineNumbers = method.getLineNumberTable(); if (lineNumbers == null) { return new LocalVariableAnnotation(localName, local, position1); } int line = lineNumbers.getSourceLine(position1); return new LocalVariableAnnotation(localName, local, position1, line); }
if (iteratorBug != null) { if (isRegisterStore()) { LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { LocalVariable localVariable = lvt.getLocalVariable(getRegisterOperand(), getNextPC());
LocalVariableTable lvt = getMethod().getLocalVariableTable(); if(lvt != null) { LocalVariable localVariable = lvt.getLocalVariable(getRegisterOperand(), getNextPC());
private void analyzeMethod(ClassContext classContext, Method method) throws CheckedAnalysisException { LocalVariableTable lvt = method.getLocalVariableTable(); UselessValuesContext context = new UselessValuesContext(classContext, method); context.initObservedValues();
@Override public boolean shouldVisitCode(Code obj) { LocalVariableTable lvt = getMethod().getLocalVariableTable(); return lvt != null; }
@Override public void visit(Method obj) { state = SEEN_NOTHING; varTable = obj.getLocalVariableTable(); if (varTable != null) { super.visit(obj); } }
@Override public boolean shouldVisitCode(Code obj) { flag = false; LocalVariableTable lvt = getMethod().getLocalVariableTable(); return lvt != null; }
@Override public boolean shouldVisitCode(Code obj) { LocalVariableTable lvt = getMethod().getLocalVariableTable(); return lvt != null; }
@Override public boolean shouldVisitCode(Code obj) { flag = false; LocalVariableTable lvt = getMethod().getLocalVariableTable(); return lvt != null; }
/** * implements the visitor to collect parameter registers * * @param obj * the context object of the currently parsed method */ @Override public void visitMethod(Method obj) { suspectLocals.clear(); int[] parmRegs = RegisterUtils.getParameterRegisters(obj); for (int pr : parmRegs) { suspectLocals.put(Integer.valueOf(pr), new RegisterInfo(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), pr, 0))); } }
/** * implements the visitor to collect parameter registers * * @param obj * the context object of the currently parsed method */ @Override public void visitMethod(Method obj) { suspectLocals.clear(); int[] parmRegs = RegisterUtils.getParameterRegisters(obj); for (int pr : parmRegs) { suspectLocals.put(Integer.valueOf(pr), new RegisterInfo(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), pr, 0))); } }
public boolean isRiskyStoreClass(int reg) { LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { LocalVariable lv = lvt.getLocalVariable(reg, getNextPC()); if ((lv != null) && dangerousStoreClassSigs.contains(lv.getSignature())) { return true; } } return false; }
public boolean isRiskyStoreClass(int reg) { LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { LocalVariable lv = lvt.getLocalVariable(reg, getNextPC()); if ((lv != null) && dangerousStoreClassSigs.contains(lv.getSignature())) { return true; } } return false; }
/** * implements the visitor to pass through constructors and static initializers to the byte code scanning code. These methods are not reported, but are used * to build SourceLineAnnotations for fields, if accessed. * * @param obj * the context object of the currently parsed code attribute */ @Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { super.visitCode(obj); } }
/** * implements the visitor to pass through constructors and static initializers to the byte code scanning code. These methods are not reported, but are used * to build SourceLineAnnotations for fields, if accessed. * * @param obj * the context object of the currently parsed code attribute */ @Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { super.visitCode(obj); } }
private void sawLoad(int seen) { lastLoadWasString = false; LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { LocalVariable lv = LVTHelper.getLocalVariableAtPC(lvt, RegisterUtils.getALoadReg(this, seen), getPC()); if (lv != null) { lastLoadWasString = Values.SIG_JAVA_LANG_STRING.equals(lv.getSignature()); } } }
private void sawLoad(int seen) { lastLoadWasString = false; LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { LocalVariable lv = LVTHelper.getLocalVariableAtPC(lvt, RegisterUtils.getALoadReg(this, seen), getPC()); if (lv != null) { lastLoadWasString = Values.SIG_JAVA_LANG_STRING.equals(lv.getSignature()); } } }
private void pushByLocalObjectLoad(DismantleBytecode dbc, int register) { Method m = dbc.getMethod(); LocalVariableTable lvt = m.getLocalVariableTable(); if (lvt != null) { LocalVariable lv = LVTHelper.getLocalVariableAtPC(lvt, register, dbc.getPC()); if (lv != null) { String signature = lv.getSignature(); pushByLocalLoad(signature, register); return; } } pushByLocalLoad("Ljava/lang/Object;", register); }