summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/fuzzing.h10
-rw-r--r--test/passes/translate-to-fuzz.txt2009
2 files changed, 1038 insertions, 981 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index a4c4e054b..88785beb4 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -145,6 +145,12 @@ private:
size_t pos; // the position in the input
bool finishedInput; // whether we already cycled through all the input (if so, we should try to finish things off)
+ // The maximum amount of params to each function.
+ static const int MAX_PARAMS = 10;
+
+ // The maximum amount of vars in each function.
+ static const int MAX_VARS = 20;
+
// some things require luck, try them a few times
static const int TRIES = 10;
@@ -359,13 +365,13 @@ private:
func->name = std::string("func_") + std::to_string(num);
func->result = getReachableType();
assert(typeLocals.empty());
- Index numParams = upToSquared(5);
+ Index numParams = upToSquared(MAX_PARAMS);
for (Index i = 0; i < numParams; i++) {
auto type = getConcreteType();
typeLocals[type].push_back(func->params.size());
func->params.push_back(type);
}
- Index numVars = upToSquared(10);
+ Index numVars = upToSquared(MAX_VARS);
for (Index i = 0; i < numVars; i++) {
auto type = getConcreteType();
typeLocals[type].push_back(func->params.size() + func->vars.size());
diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt
index 4df3f08ca..7edb06934 100644
--- a/test/passes/translate-to-fuzz.txt
+++ b/test/passes/translate-to-fuzz.txt
@@ -1,37 +1,36 @@
(module
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
- (type $FUNCSIG$j (func (result i64)))
- (type $FUNCSIG$jddi (func (param f64 f64 i32) (result i64)))
+ (type $FUNCSIG$ifj (func (param f32 i64) (result i32)))
(global $global$0 (mut f32) (f32.const 536870912))
(global $global$1 (mut f32) (f32.const 2147483648))
(global $global$2 (mut f64) (f64.const -1048576))
(global $global$3 (mut f64) (f64.const 23643))
(global $hangLimit (mut i32) (i32.const 10))
- (table 8 anyfunc)
- (elem (i32.const 0) $func_0 $func_0 $func_0 $func_0 $func_4 $func_4 $func_5 $func_8)
+ (table 4 anyfunc)
+ (elem (i32.const 0) $func_2 $func_4 $func_5 $func_8)
(memory $0 (shared 1 1))
(data (i32.const 0) "n\00\05E\00\00\00\00")
(export "func_0" (func $func_0))
- (export "func_1" (func $func_1))
- (export "func_2" (func $func_2))
(export "func_2_invoker" (func $func_2_invoker))
(export "func_4" (func $func_4))
- (export "func_6" (func $func_6))
- (export "func_6_invoker" (func $func_6_invoker))
+ (export "func_5" (func $func_5))
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $func_0 (; 0 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
- (local $1 f64)
- (local $2 i64)
- (local $3 i64)
+ (local $1 i64)
+ (local $2 f32)
+ (local $3 f64)
+ (local $4 f32)
+ (local $5 f32)
+ (local $6 f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i32.const 1159202307)
+ (get_local $0)
)
)
(set_global $hangLimit
@@ -41,24 +40,40 @@
)
)
)
- (block $label$0 (result i32)
+ (tee_local $0
+ (get_local $0)
+ )
+ )
+ (func $func_1 (; 1 ;) (param $0 f64) (param $1 f64)
+ (local $2 f64)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 i32)
+ (block
(if
- (tee_local $0
- (i32.const 1577934664)
+ (i32.eqz
+ (get_global $hangLimit)
)
- (block $label$1
- (set_local $1
- (f64.const 9223372036854775808)
- )
- (loop $label$2
+ (return)
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (block $label$1
+ (br_if $label$0
+ (loop $label$2 (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
- (return
- (get_local $0)
- )
+ (return)
)
(set_global $hangLimit
(i32.sub
@@ -67,211 +82,61 @@
)
)
)
- (block $label$3
- (set_local $0
- (block $label$4 (result i32)
- (set_local $0
- (br_if $label$0
- (i32.const 20063)
- (if (result i32)
- (i32.eqz
- (br_if $label$4
- (br_if $label$4
- (get_local $0)
- (i32.eqz
- (if (result i32)
- (i32.eqz
- (if (result i32)
- (get_local $0)
- (i32.wrap/i64
- (tee_local $3
- (get_local $3)
- )
- )
- (get_local $0)
- )
- )
- (block $label$6 (result i32)
- (nop)
- (i32.const -127)
- )
- (block $label$7 (result i32)
- (set_local $0
- (i32.const -65535)
- )
- (loop $label$8 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i32.const 1696270109)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (get_local $0)
- )
- )
- )
- )
- )
- (loop $label$5 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i32.const 1499815233)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (set_local $1
- (tee_local $1
- (f64.const -nan:0xfffffffffffb5)
- )
- )
- (br_if $label$5
- (i32.eqz
- (tee_local $0
- (tee_local $0
- (get_local $0)
- )
- )
- )
- )
- (tee_local $0
- (get_local $0)
- )
- )
- )
- )
- )
- (loop $label$9 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i32.const -2048)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (nop)
- (br_if $label$9
- (i32.eqz
- (block $label$10 (result i32)
- (nop)
- (loop $label$11 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (get_local $0)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (block $label$12
- (block $label$13
- (nop)
- (set_local $2
- (get_local $2)
- )
- )
- (set_local $2
- (get_local $2)
- )
- )
- (br_if $label$11
- (i32.const -1024)
- )
- (i32.const 65536)
- )
- )
- )
- )
- )
- (tee_local $0
- (tee_local $0
- (tee_local $0
- (get_local $0)
- )
- )
- )
- )
- )
- (tee_local $0
- (i32.const 2004515908)
- )
+ (block $label$3 (result i32)
+ (block $label$4
+ (loop $label$5
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return)
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
)
- (br $label$1)
+ (nop)
)
- )
- (br_if $label$1
- (i32.eqz
- (get_local $0)
+ (set_local $3
+ (get_local $4)
)
)
+ (i32.const 1964724085)
)
)
)
- (set_local $1
- (get_local $1)
- )
- )
- (if (result i32)
- (i32.eqz
- (get_local $0)
- )
- (tee_local $0
- (i32.const 127)
+ (i64.store offset=22 align=2
+ (i32.and
+ (tee_local $3
+ (get_local $3)
+ )
+ (i32.const 15)
+ )
+ (i64.const 8796093022208)
)
- (get_local $0)
)
)
)
- (func $func_1 (; 1 ;) (type $FUNCSIG$i) (result i32)
- (local $0 f64)
+ (func $func_2 (; 2 ;) (param $0 i32) (param $1 f64) (param $2 i64) (result f32)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 i64)
+ (local $6 i64)
+ (local $7 i32)
+ (local $8 i64)
+ (local $9 f64)
+ (local $10 i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i32.const -94)
+ (f32.const 20550)
)
)
(set_global $hangLimit
@@ -281,25 +146,56 @@
)
)
)
- (block $label$0 (result i32)
- (nop)
- (set_local $0
- (f64.const -3402823466385288598117041e14)
+ (f32.load offset=3 align=1
+ (i32.and
+ (block $label$0 (result i32)
+ (set_local $9
+ (if (result f64)
+ (tee_local $4
+ (i32.const 318767360)
+ )
+ (block $label$1 (result f64)
+ (return
+ (f32.const -8796093022208)
+ )
+ )
+ (block $label$2 (result f64)
+ (set_local $8
+ (i64.const 562949953421312)
+ )
+ (return
+ (f32.const 12849)
+ )
+ )
+ )
+ )
+ (return
+ (f32.const 288230376151711744)
+ )
+ )
+ (i32.const 15)
)
- (return
- (i32.const -105)
+ )
+ )
+ (func $func_2_invoker (; 3 ;) (type $FUNCSIG$v)
+ (drop
+ (call $func_2
+ (i32.const 1091126348)
+ (f64.const 576460752303423488)
+ (i64.const 127)
)
)
)
- (func $func_2 (; 2 ;) (type $FUNCSIG$v)
- (local $0 f32)
- (local $1 i64)
+ (func $func_4 (; 4 ;) (type $FUNCSIG$ifj) (param $0 f32) (param $1 i64) (result i32)
+ (local $2 i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
- (return)
+ (return
+ (i32.const -72)
+ )
)
(set_global $hangLimit
(i32.sub
@@ -308,56 +204,18 @@
)
)
)
- (block $label$0
- (set_local $0
- (tee_local $0
- (loop $label$1 (result f32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (tee_local $0
- (tee_local $0
- (tee_local $0
- (get_local $0)
- )
- )
- )
- )
- )
- )
- (set_local $0
- (tee_local $0
- (tee_local $0
- (get_local $0)
- )
- )
- )
- (nop)
- )
+ (i32.const -16777216)
)
- (func $func_2_invoker (; 3 ;) (type $FUNCSIG$v)
- (call $func_2)
- )
- (func $func_4 (; 4 ;) (type $FUNCSIG$j) (result i64)
+ (func $func_5 (; 5 ;) (type $FUNCSIG$v)
+ (local $0 f32)
+ (local $1 f64)
+ (local $2 f32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
- (return
- (i64.const -55)
- )
+ (return)
)
(set_global $hangLimit
(i32.sub
@@ -366,16 +224,28 @@
)
)
)
- (i64.const -2147483647)
+ (block $label$0
+ (f64.store offset=22 align=2
+ (i32.const -33554432)
+ (f64.const 32125)
+ )
+ (call $func_5)
+ )
)
- (func $func_5 (; 5 ;) (param $0 i64) (param $1 i64) (param $2 i32) (result f32)
+ (func $func_6 (; 6 ;) (result f32)
+ (local $0 f32)
+ (local $1 f64)
+ (local $2 i64)
+ (local $3 f32)
+ (local $4 f64)
+ (local $5 i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 6.635207710723736e-16)
+ (get_local $3)
)
)
(set_global $hangLimit
@@ -385,35 +255,35 @@
)
)
)
- (block $label$0 (result f32)
- (loop $label$1
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 34359738368)
- )
+ (loop $label$0 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (return
+ (f32.const -9223372036854775808)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
- (block $label$2
- (block $label$3
- (block $label$4
- (loop $label$5
+ )
+ (block (result f32)
+ (block $label$1
+ (br_if $label$0
+ (i32.eqz
+ (loop $label$2 (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 77)
+ (f32.const -9223372036854775808)
)
)
(set_global $hangLimit
@@ -423,74 +293,19 @@
)
)
)
- (block
- (set_local $1
- (loop $label$6 (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 0.05428441986441612)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i64)
- (block $label$7
- (set_local $2
- (loop $label$8 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -83)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$9 (result i32)
- (return
- (f32.const 142.02503967285156)
- )
- )
- )
- )
- (nop)
- )
- (br_if $label$6
- (i32.const 127)
- )
- (tee_local $1
- (tee_local $0
- (get_local $1)
- )
- )
- )
+ (block (result i32)
+ (block $label$3
+ (set_local $2
+ (i64.const -4294967296)
)
- )
- (br_if $label$5
- (loop $label$10 (result i32)
+ (loop $label$4
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 891825984)
+ (get_local $0)
)
)
(set_global $hangLimit
@@ -500,127 +315,205 @@
)
)
)
- (block (result i32)
- (block $label$11
- (nop)
- (set_local $0
- (loop $label$12 (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -1099511627776)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$13 (result i64)
- (nop)
- (i64.const 0)
- )
- )
- )
- )
- (br_if $label$10
- (i32.eqz
- (get_local $2)
- )
- )
- (get_local $2)
- )
- )
- )
- (if
- (i32.eqz
- (loop $label$14 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -2147483648)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$15 (result i32)
- (nop)
- (i32.const -2147483648)
- )
- )
- )
- (block $label$16
- (br_if $label$5
- (i32.eqz
- (loop $label$17 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 20584)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (block
+ (block $label$5
+ (block $label$6
+ (if
+ (tee_local $5
+ (i32.const 0)
)
- )
- (block (result i32)
- (block $label$18
- (nop)
- (set_local $0
- (tee_local $1
- (block $label$19 (result i64)
- (set_local $0
- (tee_local $1
- (tee_local $0
- (i64.const 1807380624262974543)
+ (block $label$7
+ (set_local $2
+ (if (result i64)
+ (if (result i32)
+ (get_local $5)
+ (block $label$8 (result i32)
+ (loop $label$9
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $3)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block
+ (block $label$10
+ (set_local $5
+ (get_local $5)
+ )
+ (loop $label$11
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f32.const 10224159)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (get_local $5)
+ (set_local $1
+ (loop $label$12 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f32.const 33554432)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f64)
+ (set_local $5
+ (get_local $5)
+ )
+ (br_if $label$12
+ (get_local $5)
+ )
+ (f64.const 4294967287)
+ )
+ )
+ )
+ (set_local $4
+ (tee_local $4
+ (f64.const 1.0166542203434788e-128)
+ )
+ )
+ )
+ )
+ )
+ (br_if $label$9
+ (i32.const -65536)
+ )
+ (if
+ (get_local $5)
+ (set_local $1
+ (loop $label$13 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f32.const 1.8506835061833649e-13)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (f64.const -16384)
+ )
+ )
+ (set_local $0
+ (call $func_6)
+ )
+ )
)
)
+ (br $label$5)
)
- (loop $label$20 (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
+ (block $label$14 (result i32)
+ (block $label$15
+ (br_if $label$1
+ (i32.const -32768)
+ )
+ (br_if $label$2
+ (get_local $5)
+ )
+ )
+ (tee_local $5
+ (loop $label$16 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $3)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
)
- (return
- (f32.const 9.902632491787244e-09)
+ (block (result i32)
+ (set_local $2
+ (get_local $2)
+ )
+ (br_if $label$16
+ (i32.eqz
+ (get_local $5)
+ )
+ )
+ (br_if $label$14
+ (i32.const -128)
+ (i32.eqz
+ (i32.const -76)
+ )
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ )
+ )
+ )
+ (loop $label$17 (result i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f32.const 9223372036854775808)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
- (block (result i64)
- (loop $label$21
+ )
+ (block (result i64)
+ (block $label$18
+ (loop $label$19
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const -0)
+ (get_local $3)
)
)
(set_global $hangLimit
@@ -630,260 +523,235 @@
)
)
)
- (set_local $2
- (get_local $2)
+ (set_local $0
+ (tee_local $3
+ (get_local $0)
+ )
)
)
- (br_if $label$20
- (loop $label$22 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -nan:0x7fffcf)
- )
+ (loop $label$20
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (return
+ (get_local $3)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
- (get_local $2)
)
+ (nop)
)
- (if (result i64)
- (get_local $2)
- (i64.const 70368744177664)
- (get_local $1)
+ )
+ (br_if $label$17
+ (i32.eqz
+ (call $func_4
+ (get_local $0)
+ (tee_local $2
+ (tee_local $2
+ (i64.const 144115188075855872)
+ )
+ )
+ )
)
)
+ (get_local $2)
+ )
+ )
+ (block $label$22 (result i64)
+ (br_if $label$3
+ (i32.eqz
+ (i32.const 127)
+ )
)
+ (br $label$1)
)
)
)
- )
- (br_if $label$17
- (i32.eqz
- (get_local $2)
+ (set_local $2
+ (i64.const 65534)
)
)
- (get_local $2)
+ (nop)
)
+ (set_local $3
+ (f32.const 992448126130323456)
+ )
+ )
+ (set_local $3
+ (f32.const 119)
)
)
+ (br_if $label$4
+ (i32.const -2147483648)
+ )
+ (set_local $5
+ (get_local $5)
+ )
)
- (nop)
)
- (block $label$24
- (br_if $label$2
- (i32.eqz
- (loop $label$25 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -2147483648)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ )
+ (br_if $label$2
+ (i32.eqz
+ (i32.const -78)
+ )
+ )
+ (if (result i32)
+ (i32.eqz
+ (i32.const 128)
+ )
+ (i32.const 247)
+ (block $label$23 (result i32)
+ (loop $label$24
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f32.const 4.610071063378019e-28)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$25
+ (set_local $4
+ (tee_local $1
+ (tee_local $4
+ (tee_local $1
+ (f64.const -512)
)
)
)
- (block $label$26 (result i32)
- (br_if $label$25
- (i32.const 65449)
+ )
+ (set_local $2
+ (i64.const 2147483647)
+ )
+ )
+ )
+ (tee_local $5
+ (tee_local $5
+ (br_if $label$23
+ (get_local $5)
+ (tee_local $5
+ (tee_local $5
+ (tee_local $5
+ (tee_local $5
+ (i32.const -13)
+ )
+ )
)
- (i32.const 336860180)
)
)
)
)
- (nop)
)
)
)
)
- (br_if $label$2
- (i32.eqz
- (tee_local $2
- (loop $label$27 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 70368744177664)
- )
+ )
+ )
+ (set_local $3
+ (get_local $3)
+ )
+ )
+ (br_if $label$0
+ (i32.ge_s
+ (i32.const -4194304)
+ (block $label$27 (result i32)
+ (if
+ (get_local $5)
+ (set_local $4
+ (loop $label$28 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (return
+ (f32.const 8)
)
)
- (block $label$28 (result i32)
- (tee_local $2
- (tee_local $2
- (i32.const 90)
- )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
)
- )
- )
- )
- )
- (loop $label$29
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -nan:0x7fffb7)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$30
- (set_local $2
- (get_local $2)
- )
- (set_local $2
- (tee_local $2
- (tee_local $2
- (if (result i32)
- (tee_local $2
- (tee_local $2
- (tee_local $2
- (tee_local $2
- (loop $label$31 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 4294967296)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (set_local $0
- (get_local $0)
- )
- (br_if $label$31
- (i32.eqz
- (i32.const -44)
- )
- )
- (call $func_1)
- )
- )
- )
- )
+ (tee_local $4
+ (if (result f64)
+ (i32.eqz
+ (i32.trunc_u/f64
+ (f64.const -4294967294)
)
)
- (if (result i32)
- (i32.eqz
- (get_local $2)
- )
- (block $label$32 (result i32)
- (tee_local $2
- (tee_local $2
- (i32.const 30)
- )
- )
- )
- (if (result i32)
- (block $label$33 (result i32)
- (nop)
- (br_if $label$33
- (i32.const 2147483647)
- (i32.eqz
- (i32.const 128)
- )
- )
- )
- (block $label$34 (result i32)
- (br_if $label$1
- (i32.eqz
- (get_local $2)
- )
- )
- (br_if $label$34
- (get_local $2)
- (get_local $2)
- )
- )
- (block $label$35 (result i32)
- (if
- (i32.eqz
- (get_local $2)
- )
- (set_local $2
- (get_local $2)
- )
- (br_if $label$1
- (i32.eqz
- (i32.const -1)
- )
- )
- )
- (br $label$3)
- )
+ (get_local $4)
+ (block $label$29 (result f64)
+ (set_local $4
+ (f64.const 2097152)
)
+ (br $label$28)
)
- (block $label$36 (result i32)
- (nop)
- (i32.const -10)
+ )
+ )
+ )
+ )
+ (block $label$30
+ (nop)
+ (br_if $label$30
+ (i32.atomic.rmw8_u.sub offset=3
+ (i32.and
+ (br_if $label$27
+ (get_local $5)
+ (tee_local $5
+ (get_local $5)
+ )
)
+ (i32.const 15)
+ )
+ (tee_local $5
+ (get_local $5)
)
)
)
)
)
+ (get_local $5)
)
)
- (nop)
)
- )
- (return
- (f32.const 69)
+ (f32.const 1)
)
)
)
- (func $func_6 (; 6 ;) (type $FUNCSIG$jddi) (param $0 f64) (param $1 f64) (param $2 i32) (result i64)
+ (func $func_7 (; 7 ;) (result f32)
+ (local $0 i32)
+ (local $1 f64)
+ (local $2 f32)
(local $3 f64)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 i64)
+ (local $7 i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const 3336938918731730224)
+ (f32.const 2147483648)
)
)
(set_global $hangLimit
@@ -893,77 +761,18 @@
)
)
)
- (block $label$0 (result i64)
- (nop)
- (set_local $2
- (get_local $2)
- )
- (if (result i64)
- (block $label$25 (result i32)
- (set_global $global$2
- (get_local $1)
- )
- (tee_local $2
- (tee_local $2
- (tee_local $2
- (tee_local $2
- (tee_local $2
- (get_local $2)
- )
- )
- )
- )
- )
- )
- (block $label$26 (result i64)
- (nop)
- (return
- (i64.const -524288)
- )
- )
- (block $label$27 (result i64)
- (nop)
- (return
- (i64.const -32767)
- )
- )
- )
- )
- )
- (func $func_6_invoker (; 7 ;) (type $FUNCSIG$v)
- (drop
- (call $func_6
- (f64.const 16384)
- (f64.const -nan:0xfffffffffffc8)
- (i32.const 32768)
- )
- )
- )
- (func $func_8 (; 8 ;) (param $0 i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
+ (block $label$0 (result f32)
+ (get_local $2)
)
- (nop)
)
- (func $func_9 (; 9 ;) (param $0 i32) (result i64)
+ (func $func_8 (; 8 ;) (param $0 f64) (param $1 f32) (param $2 i32) (param $3 f64) (result f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const 1)
+ (get_local $0)
)
)
(set_global $hangLimit
@@ -973,14 +782,14 @@
)
)
)
- (loop $label$0 (result i64)
+ (loop $label$0 (result f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -2147483647)
+ (get_local $0)
)
)
(set_global $hangLimit
@@ -990,17 +799,18 @@
)
)
)
- (block (result i64)
- (block $label$1
- (block $label$2
- (loop $label$3
+ (block (result f64)
+ (nop)
+ (br_if $label$0
+ (i32.eqz
+ (loop $label$1 (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const 8589934592)
+ (f64.const 72)
)
)
(set_global $hangLimit
@@ -1010,22 +820,17 @@
)
)
)
- (block $label$4
- (br_if $label$3
- (i32.eqz
- (get_local $0)
- )
- )
- (if
- (i32.eqz
- (loop $label$5 (result i32)
+ (block (result i32)
+ (block $label$2
+ (set_local $2
+ (loop $label$3 (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -88)
+ (get_local $3)
)
)
(set_global $hangLimit
@@ -1035,291 +840,422 @@
)
)
)
- (block (result i32)
- (block $label$6
- (nop)
- (set_local $0
- (block $label$7 (result i32)
- (nop)
- (tee_local $0
- (br_if $label$7
- (tee_local $0
- (i32.atomic.load offset=22
- (i32.and
- (tee_local $0
- (get_local $0)
- )
- (i32.const 15)
- )
- )
- )
- (loop $label$8 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -65536)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (tee_local $0
- (tee_local $0
- (i32.const 2147483647)
- )
- )
- )
- )
- )
- )
- )
+ (block $label$4 (result i32)
+ (br $label$1)
+ )
+ )
+ )
+ (loop $label$5
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (br_if $label$5
- (i32.eqz
- (i32.const 65443)
- )
+ (return
+ (f64.const 137438953472)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
- (i32.const -131072)
)
)
- )
- (block $label$9
- (nop)
- (nop)
- )
- (if
- (i32.eqz
- (loop $label$10 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
+ (block
+ (block $label$6
+ (set_local $2
+ (get_local $2)
+ )
+ (loop $label$7
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
)
- (return
- (i64.const -4)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (br_if $label$5
+ (block $label$8 (result i32)
+ (set_local $0
+ (f64.const -4)
+ )
+ (br $label$5)
)
)
)
- (block $label$11 (result i32)
- (nop)
- (br $label$3)
- )
)
- )
- (block $label$12
- (nop)
- (nop)
- )
- (set_local $0
- (tee_local $0
- (tee_local $0
- (i32.const -2147483648)
- )
+ (br_if $label$5
+ (i32.const 1785357419)
)
- )
- )
- )
- )
- )
- (nop)
- )
- (br_if $label$0
- (i32.eqz
- (get_local $0)
- )
- )
- )
- (br_if $label$0
- (i32.eqz
- (loop $label$13 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 362837742134036742)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (get_local $0)
- )
- )
- )
- (if (result i64)
- (block $label$14 (result i32)
- (loop $label$15
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 4294967295)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$16
- (call $func_2)
- (set_local $0
- (tee_local $0
- (i32.const 16384)
- )
- )
- )
- (br_if $label$15
- (i32.const 354293528)
- )
- (if
- (i32.eqz
- (br_if $label$14
- (i32.const -1024)
- (br_if $label$14
- (get_local $0)
+ (set_local $2
(if (result i32)
- (i32.eqz
- (br_if $label$14
- (br_if $label$14
- (br_if $label$14
- (loop $label$17 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 512)
+ (loop $label$9 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (block $label$10
+ (set_local $2
+ (i32.const 514)
+ )
+ (set_local $2
+ (get_local $2)
+ )
+ )
+ (br_if $label$9
+ (block $label$11 (result i32)
+ (br_if $label$5
+ (i32.eqz
+ (loop $label$12 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 2.573976383481498e-159)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (block $label$13 (result i32)
+ (nop)
+ (br $label$9)
)
)
)
- (i32.const -128)
)
- (i32.eqz
+ (br $label$0)
+ )
+ )
+ (block $label$14 (result i32)
+ (set_local $0
+ (tee_local $0
(get_local $0)
)
)
(br_if $label$14
- (get_local $0)
- (i32.const -32768)
+ (tee_local $2
+ (i32.const -127)
+ )
+ (block $label$15 (result i32)
+ (if
+ (get_local $2)
+ (block $label$16
+ (loop $label$17
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block
+ (set_local $3
+ (get_local $3)
+ )
+ (br_if $label$17
+ (i32.eqz
+ (block $label$18 (result i32)
+ (set_local $0
+ (f64.const 7)
+ )
+ (loop $label$19 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const -nan:0xfffffffffffee)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (set_local $0
+ (get_local $3)
+ )
+ (br_if $label$19
+ (get_local $2)
+ )
+ (i32.const -255)
+ )
+ )
+ )
+ )
+ )
+ (set_local $3
+ (f64.const 0.0056707351085018)
+ )
+ )
+ )
+ (block $label$20
+ (nop)
+ (nop)
+ )
+ )
+ (block $label$21
+ (br_if $label$2
+ (get_local $2)
+ )
+ (set_local $1
+ (get_local $1)
+ )
+ )
+ )
+ (br $label$1)
+ )
)
)
- (i32.eqz
- (i32.const 1380139090)
- )
)
)
- (block $label$18 (result i32)
- (loop $label$19
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -137438953472)
+ (block $label$22 (result i32)
+ (if
+ (i32.eqz
+ (i32.const -32768)
+ )
+ (set_local $1
+ (tee_local $1
+ (call $deNan32
+ (select
+ (tee_local $1
+ (block $label$26 (result f32)
+ (set_local $2
+ (i32.const 19027)
+ )
+ (br $label$5)
+ )
+ )
+ (f32.const 1540)
+ (loop $label$23 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 34359738368)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (block $label$24
+ (set_local $3
+ (f64.const -512)
+ )
+ (set_local $0
+ (get_local $3)
+ )
+ )
+ (br_if $label$23
+ (i32.eqz
+ (tee_local $2
+ (br_if $label$22
+ (i32.const 4)
+ (get_local $2)
+ )
+ )
+ )
+ )
+ (loop $label$25 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 28)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const -50)
+ )
+ )
+ )
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ )
+ (block $label$28
+ (nop)
+ (set_local $2
+ (br_if $label$22
+ (i32.const -2147483647)
+ (i32.eqz
+ (get_local $2)
+ )
)
)
)
- (block $label$20
- (set_local $0
- (i32.const 512)
+ )
+ (if (result i32)
+ (i32.eqz
+ (block $label$29 (result i32)
+ (tee_local $2
+ (tee_local $2
+ (tee_local $2
+ (tee_local $2
+ (i32.const -65535)
+ )
+ )
+ )
+ )
)
- (loop $label$21
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
+ )
+ (block $label$30 (result i32)
+ (set_local $2
+ (loop $label$31 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const -3402823466385288598117041e14)
+ )
)
- (return
- (i64.const 2199023255552)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (block $label$32 (result i32)
+ (br_if $label$22
+ (get_local $2)
+ (loop $label$33 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 17672)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (block $label$34
+ (nop)
+ )
+ (br_if $label$33
+ (i32.eqz
+ (tee_local $2
+ (i32.const 6)
+ )
+ )
+ )
+ (get_local $2)
+ )
+ )
)
)
)
- (br_if $label$15
- (tee_local $0
- (f32.le
- (f32.const 3.989732680786937e-31)
- (f32.const 8192)
- )
- )
+ )
+ (br_if $label$22
+ (tee_local $2
+ (i32.const 32)
+ )
+ (i32.eqz
+ (get_local $2)
)
)
)
- )
- (block $label$22 (result i32)
- (loop $label$23
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 1145899072)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (br_if $label$22
+ (get_local $2)
+ (i32.eqz
+ (i32.lt_u
+ (get_local $2)
+ (tee_local $2
+ (tee_local $2
+ (if (result i32)
+ (i32.const -16)
+ (i32.const -32768)
+ (tee_local $2
+ (get_local $2)
+ )
+ )
+ )
)
)
)
- (block $label$24
- (set_local $0
- (i32.const 0)
- )
- (loop $label$25
+ )
+ )
+ )
+ (block $label$35 (result i32)
+ (set_local $1
+ (tee_local $1
+ (tee_local $1
+ (loop $label$36 (result f32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const 134217728)
+ (f64.const 2147483648)
)
)
(set_global $hangLimit
@@ -1329,47 +1265,162 @@
)
)
)
- (block
- (nop)
- (br_if $label$25
- (i32.const 84691274)
+ (block (result f32)
+ (if
+ (if (result i32)
+ (i32.eqz
+ (i32.const -112)
+ )
+ (i32.const 67108864)
+ (loop $label$37 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 20054)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (nop)
+ (br_if $label$37
+ (i32.eqz
+ (i32.const 486999634)
+ )
+ )
+ (i32.const 134217728)
+ )
+ )
+ )
+ (block $label$38
+ (set_local $2
+ (get_local $2)
+ )
+ (br_if $label$36
+ (i32.const 341772310)
+ )
+ )
+ (block $label$39
+ (loop $label$40
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (nop)
+ )
+ (if
+ (i32.eqz
+ (tee_local $2
+ (get_local $2)
+ )
+ )
+ (set_local $3
+ (get_local $3)
+ )
+ (set_local $2
+ (i32.const 2147483647)
+ )
+ )
+ )
+ )
+ (br_if $label$36
+ (i32.load16_s offset=22
+ (i32.and
+ (br_if $label$35
+ (i32.const -128)
+ (i32.eqz
+ (i32.const 4096)
+ )
+ )
+ (i32.const 15)
+ )
+ )
+ )
+ (tee_local $1
+ (tee_local $1
+ (loop $label$41 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f32)
+ (br_if $label$5
+ (i32.eqz
+ (i32.const -131072)
+ )
+ )
+ (br_if $label$41
+ (i32.const 425480269)
+ )
+ (f32.const -nan:0x7fffe7)
+ )
+ )
+ )
)
- (nop)
)
)
)
)
- (get_local $0)
)
- )
- (block $label$26 (result i32)
- (i32.const 1459819012)
+ (i32.const -83)
)
)
)
)
)
- (nop)
- (block $label$27
- (nop)
+ )
+ (br_if $label$1
+ (i32.eqz
+ (i32.const -128)
)
)
+ (i32.const 1)
)
)
- (get_local $0)
)
- (i64.const -29)
- (i64.const 7425313271795557411)
)
+ (get_local $0)
)
)
)
- (func $hangLimitInitializer (; 10 ;)
+ (func $hangLimitInitializer (; 9 ;)
(set_global $hangLimit
(i32.const 10)
)
)
- (func $deNan32 (; 11 ;) (param $0 f32) (result f32)
+ (func $deNan32 (; 10 ;) (param $0 f32) (result f32)
(if (result f32)
(f32.eq
(get_local $0)
@@ -1379,7 +1430,7 @@
(f32.const 0)
)
)
- (func $deNan64 (; 12 ;) (param $0 f64) (result f64)
+ (func $deNan64 (; 11 ;) (param $0 f64) (result f64)
(if (result f64)
(f64.eq
(get_local $0)