Skip to content

Commit

Permalink
Fix compiler warning
Browse files Browse the repository at this point in the history
Could not be an NPE previously anyway
  • Loading branch information
garydgregory committed Nov 27, 2022
1 parent be4aec1 commit ce634b1
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -943,19 +943,18 @@ private Field visitFieldInstructionInternals(final FieldInstruction o) throws Cl
shouldBe = Type.INT;
}
if (t instanceof ReferenceType) {
ReferenceType rValue = null;
if (value instanceof ReferenceType) {
rValue = (ReferenceType) value;
ReferenceType rValue = (ReferenceType) value;
referenceTypeIsInitialized(o, rValue);
// TODO: This can possibly only be checked using Staerk-et-al's "set-of-object types", not
// using "wider cast object types" created during verification.
// Comment it out if you encounter problems. See also the analogon at visitPUTFIELD|visitPUTSTATIC.
if (!rValue.isAssignmentCompatibleWith(shouldBe)) {
constraintViolated(o, "The stack top type '" + value + "' is not assignment compatible with '" + shouldBe + "'.");
}
} else {
constraintViolated(o, "The stack top type '" + value + "' is not of a reference type as expected.");
}
// TODO: This can possibly only be checked using Staerk-et-al's "set-of-object types", not
// using "wider cast object types" created during verification.
// Comment it out if you encounter problems. See also the analogon at visitPUTFIELD|visitPUTSTATIC.
if (!rValue.isAssignmentCompatibleWith(shouldBe)) {
constraintViolated(o, "The stack top type '" + value + "' is not assignment compatible with '" + shouldBe + "'.");
}
} else if (shouldBe != value) {
constraintViolated(o, "The stack top type '" + value + "' is not of type '" + shouldBe + "' as expected.");
}
Expand Down

0 comments on commit ce634b1

Please sign in to comment.