Skip to content

Commit

Permalink
whoops we actually did need to fuzz shorts
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-bell committed Aug 1, 2024
1 parent ef327f7 commit 349156c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fuzz/src/main/java/edu/berkeley/cs/jqf/fuzz/ei/ZestGuidance.java
Original file line number Diff line number Diff line change
Expand Up @@ -1628,8 +1628,15 @@ public Input fuzz(Random random) {
case Byte:
newInput.set(offset + 1, setToZero ? 0 : (byte) random.nextInt(256));
break;
case Short:
throw new GuidanceException("Short type not supported");
case Short:
if (setToZero) {
newInput.set(offset + 1, (byte) 0);
newInput.set(offset + 2, (byte) 0);
} else {
newInput.set(offset + 1, (byte) random.nextInt(256));
newInput.set(offset + 2, (byte) random.nextInt(256));
}
break;
case Integer:
int newIValue = random.nextInt();
if(setToZero){
Expand Down

0 comments on commit 349156c

Please sign in to comment.