private boolean hasHardCodedFieldSource(OpcodeStack.Item stackItem) { XField xField = stackItem.getXField(); if (xField == null) { return false; } String[] split = xField.toString().split(" "); int length = split.length; if (length < 2) { return false; } String fieldSignature = split[length - 1]; if (!isSupportedSignature(fieldSignature)) { return false; } String fieldName = split[length - 2] + fieldSignature; return hardCodedFields.contains(fieldName); }
private String getStackFieldName(int offset) { XField xField = stack.getStackItem(offset).getXField(); if (xField == null) { return null; } String[] split = xField.toString().split(" "); if (split.length < 2) { return null; } return split[split.length - 2] + split[split.length - 1]; }
/** Use getXField instead */ @Deprecated public FieldAnnotation getFieldAnnotation() { return FieldAnnotation.fromXField(getXField()); }
/** Use getXField instead */ @Deprecated public FieldAnnotation getFieldAnnotation() { return FieldAnnotation.fromXField(getXField()); }
private void processInvoke() { String sig = getSigConstantOperand(); int argCount = SignatureUtils.getNumParameters(sig); if (stack.getStackDepth() > argCount) { OpcodeStack.Item invokeeItem = stack.getStackItem(argCount); XField fieldOnWhichMethodIsInvoked = invokeeItem.getXField(); if (fieldOnWhichMethodIsInvoked != null) { removeCandidateIfShutdownCalled(fieldOnWhichMethodIsInvoked); addExemptionIfShutdownCalled(fieldOnWhichMethodIsInvoked); } } }
public SetRef(OpcodeStack.Item itm) { int reg = itm.getRegisterNumber(); if (reg >= 0) { register = reg; } else { XField xf = itm.getXField(); if (xf != null) { field = xf; } register = -1; } }
private String getStackFieldName(int offset) { XField xField = stack.getStackItem(offset).getXField(); if (xField == null) { return null; } String[] split = xField.toString().split(" "); if (split.length < 2) { return null; } return split[split.length - 2] + split[split.length - 1]; }
String primitiveType = ClassName.getPrimitiveType(called.getClassDescriptor().getClassName()); XMethod rvo = stack.getStackItem(1).getReturnValueOf(); XField field = stack.getStackItem(1).getXField(); String signature; if (rvo != null) {
XField f = item.getXField(); if (f != null) { data.nullTested.add(f); OpcodeStack.Item item0 = stack.getStackItem(0); OpcodeStack.Item item1 = stack.getStackItem(1); XField field1 = item1.getXField(); if (item0.isNull() && field1 != null) { data.nullTested.add(field1); } else { XField field0 = item0.getXField(); if (item1.isNull() && field0 != null) { data.nullTested.add(field0); XField f = item.getXField(); if (f != null && !f.isStatic()
OpcodeStack.Item third = stack.getStackItem(2); OpcodeStack.Item fourth = stack.getStackItem(3); XField f2 = third.getXField(); int registerNumber2 = fourth.getRegisterNumber(); if (f2 != null && f2.equals(getXFieldOperand()) && registerNumber2 >= 0 XField f = top.getXField(); int registerNumber = next.getRegisterNumber(); if (f != null && f.equals(getXFieldOperand()) && registerNumber >= 0
XField field = top.getXField(); FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary(); OpcodeStack.Item summary = fieldSummary.getSummary(field);
private MethodCall getMethodCall(MethodDescriptor methodDescriptorOperand) { Item objItem = getStack().getStackItem(getNumberArguments(methodDescriptorOperand.getSignature())); if (isNew(objItem)) { return new MethodCall(methodDescriptorOperand, TARGET_NEW); } if (objItem.getRegisterNumber() == 0 && !getMethod().isStatic()) { return new MethodCall(methodDescriptorOperand, constructor ? TARGET_NEW : TARGET_THIS); } XField xField = objItem.getXField(); if (xField != null) { if (classInit && xField.isStatic() && xField.getClassDescriptor().getClassName().equals(getClassName())) { return new MethodCall(methodDescriptorOperand, TARGET_NEW); } if (!getMethodDescriptor().isStatic() && objItem.getFieldLoadedFromRegister() == 0 && allowedFields.contains(xField.getFieldDescriptor())) { fieldsModifyingMethods.add(getMethodDescriptor()); return new MethodCall(methodDescriptorOperand, xField.getFieldDescriptor()); } } return new MethodCall(methodDescriptorOperand, TARGET_OTHER); }
public static @CheckForNull BugAnnotation getFieldOrMethodValueSource(@CheckForNull OpcodeStack.Item item) { if (item == null) { return null; } XField xField = item.getXField(); if (xField != null) { FieldAnnotation a = FieldAnnotation.fromXField(xField); a.setDescription(FieldAnnotation.LOADED_FROM_ROLE); return a; } XMethod xMethod = item.getReturnValueOf(); if (xMethod != null) { MethodAnnotation a = MethodAnnotation.fromXMethod(xMethod); a.setDescription(MethodAnnotation.METHOD_RETURN_VALUE_OF); return a; } return null; }
private void eraseKnowledgeOf(XField fieldOperand) { if (fieldOperand == null) { return; } for (Item item : stack) { if (item != null && fieldOperand.equals(item.getXField())) { item.setLoadedFromField(null, -1); } } for (Item item : lvValues) { if (item != null && fieldOperand.equals(item.getXField())) { item.setLoadedFromField(null, -1); } } }
private void checkStackValue(int arg) { Item item = getStack().getStackItem(arg); if(item.getXField() == currentDoubleCheckField) { bugReporter.reportBug(new BugInstance(this, "DC_PARTIALLY_CONSTRUCTED", NORMAL_PRIORITY).addClassAndMethod(this) .addField(currentDoubleCheckField).describe("FIELD_ON").addSourceLine(this).addSourceLine(this, assignPC) .describe("SOURCE_LINE_STORED")); stage++; } } }