Skip to content

Commit

Permalink
randomGet should be static and return int.
Browse files Browse the repository at this point in the history
  • Loading branch information
woess committed Sep 12, 2023
1 parent a0feed0 commit bf840d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Object executeWithContext(VirtualFrame frame, WasmContext context) {

@SuppressFBWarnings(value = "DMI_RANDOM_USED_ONLY_ONCE", justification = "This is a testing class only")
@CompilerDirectives.TruffleBoundary
private Object randomGet(WasmMemory memory, int buf, int size) {
private static int randomGet(WasmMemory memory, int buf, int size) {
byte[] randomData = new byte[size];
new Random(SEED).nextBytes(randomData);
memory.initialize(randomData, 0, buf, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Object executeWithContext(VirtualFrame frame, WasmContext context) {
}

@CompilerDirectives.TruffleBoundary
private Object randomGet(WasmMemory memory, int buf, int size) {
private static int randomGet(WasmMemory memory, int buf, int size) {
byte[] randomData = new byte[size];
ThreadLocalRandom.current().nextBytes(randomData);
memory.initialize(randomData, 0, buf, size);
Expand Down

0 comments on commit bf840d4

Please sign in to comment.