From 79c777839d23114e6f85322eefa6d44af53814ab Mon Sep 17 00:00:00 2001 From: Carl Smith Date: Tue, 17 Oct 2023 12:45:29 +0200 Subject: [PATCH] Add assert to the RuntimeAssistedMutator RNG --- .../Lifting/JavaScriptRuntimeAssistedMutatorLifting.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Fuzzilli/Lifting/JavaScriptRuntimeAssistedMutatorLifting.swift b/Sources/Fuzzilli/Lifting/JavaScriptRuntimeAssistedMutatorLifting.swift index c5ac31aa5..5370c4543 100644 --- a/Sources/Fuzzilli/Lifting/JavaScriptRuntimeAssistedMutatorLifting.swift +++ b/Sources/Fuzzilli/Lifting/JavaScriptRuntimeAssistedMutatorLifting.swift @@ -78,6 +78,7 @@ struct JavaScriptRuntimeAssistedMutatorLifting { } randomInt() { this.x = (this.x * this.a + this.c) % this.m; + if (!isInteger(this.x)) throw "RNG state is not an Integer!" return this.x; } randomFloat() { @@ -86,7 +87,6 @@ struct JavaScriptRuntimeAssistedMutatorLifting { probability(p) { return this.randomFloat() < p; } - reseed(seed) { this.x = seed; }