diff options
-rw-r--r-- | src/tools/fuzzing.h | 166 | ||||
-rw-r--r-- | test/passes/fuzz_metrics_noprint.bin.txt | 31 | ||||
-rw-r--r-- | test/passes/fuzz_metrics_noprint.passes | 1 | ||||
-rw-r--r-- | test/passes/fuzz_metrics_noprint.wasm | bin | 0 -> 40960 bytes | |||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features.txt | 1152 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt | 1809 |
6 files changed, 1354 insertions, 1805 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index fb83882c2..f4188eb08 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -845,6 +845,11 @@ private: return std::string("label$") + std::to_string(labelIndex++); } + // Weighting for the core make* methods. Some nodes are important enough that + // we should do them quite often. + static const size_t VeryImportant = 4; + static const size_t Important = 2; + // always call the toplevel make(type) command, not the internal specific ones int nesting = 0; @@ -884,57 +889,37 @@ private: nesting--; return ret; } + Expression* _makeConcrete(Type type) { bool canMakeControlFlow = !type.isMulti() || wasm.features.has(FeatureSet::Multivalue); - auto choice = upTo(100); - if (choice < 10) { - return makeConst(type); - } - if (choice < 30) { - return makeLocalSet(type); - } - if (choice < 50) { - return makeLocalGet(type); - } - if (choice < 60 && canMakeControlFlow) { - return makeBlock(type); - } - if (choice < 70 && canMakeControlFlow) { - return makeIf(type); - } - if (choice < 80 && canMakeControlFlow) { - return makeLoop(type); - } - if (choice < 90 && canMakeControlFlow) { - return makeBreak(type); - } using Self = TranslateToFuzzReader; FeatureOptions<Expression* (Self::*)(Type)> options; + using WeightedOption = decltype(options)::WeightedOption; options.add(FeatureSet::MVP, - &Self::makeLocalGet, - &Self::makeLocalSet, - &Self::makeGlobalGet, - &Self::makeConst); + WeightedOption{&Self::makeLocalGet, VeryImportant}, + WeightedOption{&Self::makeLocalSet, VeryImportant}, + WeightedOption{&Self::makeGlobalGet, Important}, + WeightedOption{&Self::makeConst, Important}); if (canMakeControlFlow) { options.add(FeatureSet::MVP, - &Self::makeBlock, - &Self::makeIf, - &Self::makeLoop, - &Self::makeBreak, + WeightedOption{&Self::makeBlock, Important}, + WeightedOption{&Self::makeIf, Important}, + WeightedOption{&Self::makeLoop, Important}, + WeightedOption{&Self::makeBreak, Important}, &Self::makeCall, &Self::makeCallIndirect); } if (type.isSingle()) { options .add(FeatureSet::MVP, - &Self::makeUnary, - &Self::makeBinary, + WeightedOption{&Self::makeUnary, Important}, + WeightedOption{&Self::makeBinary, Important}, &Self::makeSelect) .add(FeatureSet::Multivalue, &Self::makeTupleExtract); } if (type.isSingle() && !type.isRef()) { - options.add(FeatureSet::MVP, &Self::makeLoad); + options.add(FeatureSet::MVP, {&Self::makeLoad, Important}); options.add(FeatureSet::SIMD, &Self::makeSIMD); } if (type.isInteger()) { @@ -958,75 +943,48 @@ private: return makeMemoryHashLogging(); } } - choice = upTo(100); - if (choice < 50) { - return makeLocalSet(Type::none); - } - if (choice < 60) { - return makeBlock(Type::none); - } - if (choice < 70) { - return makeIf(Type::none); - } - if (choice < 80) { - return makeLoop(Type::none); - } - if (choice < 90) { - return makeBreak(Type::none); - } using Self = TranslateToFuzzReader; - auto options = FeatureOptions<Expression* (Self::*)(Type)>() - .add(FeatureSet::MVP, - &Self::makeBlock, - &Self::makeIf, - &Self::makeLoop, - &Self::makeBreak, - &Self::makeCall, - &Self::makeCallIndirect, - &Self::makeLocalSet, - &Self::makeStore, - &Self::makeDrop, - &Self::makeNop, - &Self::makeGlobalSet) - .add(FeatureSet::BulkMemory, &Self::makeBulkMemory) - .add(FeatureSet::Atomics, &Self::makeAtomic); + auto options = FeatureOptions<Expression* (Self::*)(Type)>(); + using WeightedOption = decltype(options)::WeightedOption; + options + .add(FeatureSet::MVP, + WeightedOption{&Self::makeLocalSet, VeryImportant}, + WeightedOption{&Self::makeBlock, Important}, + WeightedOption{&Self::makeIf, Important}, + WeightedOption{&Self::makeLoop, Important}, + WeightedOption{&Self::makeBreak, Important}, + WeightedOption{&Self::makeStore, Important}, + &Self::makeCall, + &Self::makeCallIndirect, + &Self::makeDrop, + &Self::makeNop, + &Self::makeGlobalSet) + .add(FeatureSet::BulkMemory, &Self::makeBulkMemory) + .add(FeatureSet::Atomics, &Self::makeAtomic); return (this->*pick(options))(Type::none); } Expression* _makeunreachable() { - switch (upTo(15)) { - case 0: - return makeBlock(Type::unreachable); - case 1: - return makeIf(Type::unreachable); - case 2: - return makeLoop(Type::unreachable); - case 3: - return makeBreak(Type::unreachable); - case 4: - return makeCall(Type::unreachable); - case 5: - return makeCallIndirect(Type::unreachable); - case 6: - return makeLocalSet(Type::unreachable); - case 7: - return makeStore(Type::unreachable); - case 8: - return makeUnary(Type::unreachable); - case 9: - return makeBinary(Type::unreachable); - case 10: - return makeSelect(Type::unreachable); - case 11: - return makeSwitch(Type::unreachable); - case 12: - return makeDrop(Type::unreachable); - case 13: - return makeReturn(Type::unreachable); - case 14: - return makeUnreachable(Type::unreachable); - } - WASM_UNREACHABLE("unexpected value"); + using Self = TranslateToFuzzReader; + auto options = FeatureOptions<Expression* (Self::*)(Type)>(); + using WeightedOption = decltype(options)::WeightedOption; + options.add(FeatureSet::MVP, + WeightedOption{&Self::makeLocalSet, VeryImportant}, + WeightedOption{&Self::makeBlock, Important}, + WeightedOption{&Self::makeIf, Important}, + WeightedOption{&Self::makeLoop, Important}, + WeightedOption{&Self::makeBreak, Important}, + WeightedOption{&Self::makeStore, Important}, + WeightedOption{&Self::makeUnary, Important}, + WeightedOption{&Self::makeBinary, Important}, + WeightedOption{&Self::makeUnreachable, Important}, + &Self::makeCall, + &Self::makeCallIndirect, + &Self::makeSelect, + &Self::makeSwitch, + &Self::makeDrop, + &Self::makeReturn); + return (this->*pick(options))(Type::unreachable); } // make something with no chance of infinite recursion @@ -2891,6 +2849,20 @@ private: return add(feature, rest...); } + struct WeightedOption { + T option; + size_t weight; + }; + + template<typename... Ts> + FeatureOptions<T>& + add(FeatureSet feature, WeightedOption weightedOption, Ts... rest) { + for (size_t i = 0; i < weightedOption.weight; i++) { + options[feature].push_back(weightedOption.option); + } + return add(feature, rest...); + } + FeatureOptions<T>& add(FeatureSet feature) { return *this; } std::map<FeatureSet, std::vector<T>> options; diff --git a/test/passes/fuzz_metrics_noprint.bin.txt b/test/passes/fuzz_metrics_noprint.bin.txt new file mode 100644 index 000000000..a4db4bcd6 --- /dev/null +++ b/test/passes/fuzz_metrics_noprint.bin.txt @@ -0,0 +1,31 @@ +total + [events] : 0 + [exports] : 31 + [funcs] : 45 + [globals] : 7 + [imports] : 4 + [memory-data] : 4 + [table-data] : 16 + [total] : 5788 + [vars] : 115 + binary : 453 + block : 823 + break : 242 + call : 208 + call_indirect : 47 + const : 997 + drop : 46 + global.get : 473 + global.set : 208 + if : 323 + load : 99 + local.get : 491 + local.set : 364 + loop : 148 + nop : 109 + return : 228 + select : 46 + store : 55 + switch : 3 + unary : 422 + unreachable : 3 diff --git a/test/passes/fuzz_metrics_noprint.passes b/test/passes/fuzz_metrics_noprint.passes new file mode 100644 index 000000000..10392fded --- /dev/null +++ b/test/passes/fuzz_metrics_noprint.passes @@ -0,0 +1 @@ +translate-to-fuzz_metrics diff --git a/test/passes/fuzz_metrics_noprint.wasm b/test/passes/fuzz_metrics_noprint.wasm Binary files differnew file mode 100644 index 000000000..24c4a2e2e --- /dev/null +++ b/test/passes/fuzz_metrics_noprint.wasm diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt index c55fcdf48..9662c118a 100644 --- a/test/passes/translate-to-fuzz_all-features.txt +++ b/test/passes/translate-to-fuzz_all-features.txt @@ -1,36 +1,18 @@ (module (type $none_=>_none (func)) - (type $none_=>_nullref_f64_i32_nullref_nullref (func (result nullref f64 i32 nullref nullref))) (type $i64_=>_none (func (param i64))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_i32_i32_f32_exnref_nullref (func (result i32 i32 f32 exnref nullref))) - (type $none_=>_f64 (func (result f64))) - (type $none_=>_funcref_f64_i32_anyref_anyref (func (result funcref f64 i32 anyref anyref))) - (type $none_=>_nullref_nullref_nullref_nullref_i64 (func (result nullref nullref nullref nullref i64))) + (type $none_=>_i64_v128_f32_v128_v128 (func (result i64 v128 f32 v128 v128))) (type $i32_=>_none (func (param i32))) (type $f32_=>_none (func (param f32))) (type $f64_=>_none (func (param f64))) (type $v128_=>_none (func (param v128))) (type $nullref_=>_none (func (param nullref))) (type $exnref_=>_none (func (param exnref))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $f64_anyref_=>_i32 (func (param f64 anyref) (result i32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) - (type $funcref_funcref_anyref_anyref_nullref_=>_f64 (func (param funcref funcref anyref anyref nullref) (result f64))) - (type $nullref_=>_f64 (func (param nullref) (result f64))) - (type $none_=>_v128 (func (result v128))) - (type $none_=>_funcref_i32_i64_nullref_v128 (func (result funcref i32 i64 nullref v128))) - (type $f32_=>_funcref_i32_i64_nullref_v128 (func (param f32) (result funcref i32 i64 nullref v128))) - (type $none_=>_funcref_anyref_nullref_anyref_i64 (func (result funcref anyref nullref anyref i64))) - (type $exnref_nullref_=>_funcref_anyref_nullref_anyref_i64 (func (param exnref nullref) (result funcref anyref nullref anyref i64))) - (type $none_=>_funcref_nullref (func (result funcref nullref))) - (type $exnref_f32_=>_funcref_nullref (func (param exnref f32) (result funcref nullref))) + (type $none_=>_i32 (func (result i32))) + (type $i64_v128_=>_f32 (func (param i64 v128) (result f32))) + (type $f32_=>_f64 (func (param f32) (result f64))) (type $none_=>_anyref (func (result anyref))) - (type $none_=>_nullref (func (result nullref))) - (type $i32_nullref_funcref_=>_nullref (func (param i32 nullref funcref) (result nullref))) - (type $v128_=>_nullref (func (param v128) (result nullref))) - (type $v128_exnref_v128_v128_anyref_funcref_anyref_=>_nullref (func (param v128 exnref v128 v128 anyref funcref anyref) (result nullref))) - (type $nullref_funcref_anyref_=>_exnref (func (param nullref funcref anyref) (result exnref))) + (type $f64_=>_nullref (func (param f64) (result nullref))) (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) (import "fuzzing-support" "log-i64" (func $log-i64 (param i64))) (import "fuzzing-support" "log-f32" (func $log-f32 (param f32))) @@ -38,10 +20,9 @@ (import "fuzzing-support" "log-v128" (func $log-v128 (param v128))) (import "fuzzing-support" "log-nullref" (func $log-nullref (param nullref))) (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref))) - (memory $0 1 1) + (memory $0 (shared 1 1)) (data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3") - (table $0 9 9 funcref) - (elem (i32.const 0) $func_22 $func_26 $func_26 $func_26 $func_26 $func_29 $func_31 $func_33 $func_40) + (table $0 0 funcref) (global $global$5 (mut f32) (f32.const 74)) (global $global$4 (mut nullref) (ref.null)) (global $global$3 (mut i32) (i32.const 1263230471)) @@ -57,30 +38,7 @@ (export "hashMemory" (func $hashMemory)) (export "memory" (memory $0)) (export "func_8" (func $func_8)) - (export "func_8_invoker" (func $func_8_invoker)) - (export "func_10_invoker" (func $func_10_invoker)) - (export "func_12_invoker" (func $func_12_invoker)) - (export "func_14_invoker" (func $func_14_invoker)) - (export "func_16" (func $func_16)) - (export "func_16_invoker" (func $func_16_invoker)) - (export "func_19" (func $func_19)) - (export "func_20" (func $func_20)) - (export "func_20_invoker" (func $func_20_invoker)) - (export "func_22_invoker" (func $func_22_invoker)) - (export "func_24" (func $func_24)) - (export "func_24_invoker" (func $func_24_invoker)) - (export "func_26" (func $func_26)) - (export "func_26_invoker" (func $func_26_invoker)) - (export "func_29" (func $func_29)) - (export "func_29_invoker" (func $func_29_invoker)) - (export "func_31" (func $func_31)) - (export "func_32" (func $func_32)) - (export "func_33_invoker" (func $func_33_invoker)) - (export "func_35_invoker" (func $func_35_invoker)) - (export "func_37" (func $func_37)) - (export "func_37_invoker" (func $func_37_invoker)) - (export "func_40" (func $func_40)) - (export "func_40_invoker" (func $func_40_invoker)) + (export "func_10" (func $func_10)) (export "hangLimitInitializer" (func $hangLimitInitializer)) (func $hashMemory (result i32) (local $0 i32) @@ -337,8 +295,7 @@ ) ) ) - (block $label$0 - (nop) + (block $label$0 (result anyref) (loop $label$1 (block (if @@ -346,7 +303,7 @@ (global.get $hangLimit) ) (return - (ref.null) + (local.get $4) ) ) (global.set $hangLimit @@ -357,507 +314,289 @@ ) ) (block - (nop) - (br_if $label$1 - (i32.eqz - (i32.const -8) - ) - ) - (nop) - ) - ) - (return - (local.get $4) - ) - ) - ) - (func $func_8_invoker - (drop - (call $func_8) - ) - (drop - (call $func_8) - ) - (drop - (call $func_8) - ) - ) - (func $func_10 (result nullref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (loop $label$1 - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.const 5) - ) - ) - ) - (return - (ref.null) - ) - ) - ) - (func $func_10_invoker - (drop - (call $func_10) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_12 (param $0 exnref) (param $1 f32) (result funcref nullref) - (local $2 f32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.null) - (ref.null) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (tuple.make - (ref.null) - (ref.null) - ) - ) - (func $func_12_invoker - (drop - (call $func_12 - (ref.null) - (f32.const -nan:0x7fffc8) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_12 - (ref.null) - (f32.const 18446744073709551615) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_14 (result v128) - (local $0 i64) - (local $1 i32) - (local $2 f64) - (local $3 f64) - (local $4 f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (v128.const i32x4 0xffffff01 0xffffffff 0x4e484e45 0x00000000) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (v128.const i32x4 0x00000000 0xc2800000 0xffffffb0 0x4eb61298) - ) - (func $func_14_invoker - (drop - (call $func_14) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_14) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_16 - (local $0 exnref) - (local $1 f32) - (local $2 i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (nop) - ) - (func $func_16_invoker - (call $func_16) - ) - (func $func_18 (param $0 v128) (result nullref) - (local $1 i64) - (local $2 v128) - (local $3 i32) - (local $4 nullref) - (local $5 anyref) - (local $6 f64) - (local $7 (exnref anyref exnref)) - (local $8 f32) - (local $9 (i32 v128)) - (local $10 i32) - (local $11 (f64 exnref v128 f64 f32 v128)) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $4) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (ref.null) - ) - (func $func_19 (result i32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (i32.const 18233) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (i32.const 24) - ) - (func $func_20 (param $0 nullref) (param $1 funcref) (param $2 anyref) (result exnref) - (local $3 funcref) - (local $4 exnref) - (local $5 i32) - (local $6 funcref) - (local $7 (i64 i32 v128 f32 f64)) - (local $8 f32) - (local $9 v128) - (local $10 v128) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $4) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (call $log-i32 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (loop $label$1 (result i32) - (block - (if - (i32.eqz - (global.get $hangLimit) + (block $label$2 + (atomic.fence) + (f64.store offset=3 align=2 + (i32.and + (i32.const 521278814) + (block $label$9 (result i32) + (i64.atomic.store offset=22 + (i32.and + (br_if $label$9 + (loop $label$11 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) ) - (return - (local.get $4) + (i32.const 26) + ) + (loop $label$10 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) ) + (local.get $3) + ) + ) + (i32.const 15) + ) + (i64x2.extract_lane 1 + (f32x4.lt + (i64x2.splat + (local.get $0) ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) + (v128.load offset=3 align=1 + (i32.and + (local.get $3) + (i32.const 15) ) ) ) - (block $label$2 (result i32) - (local.tee $5 - (i32.const 12588) + ) + ) + (i32.gt_u + (block $label$12 (result i32) + (if + (i32.const 521278814) + (nop) + (nop) + ) + (local.get $3) + ) + (local.tee $3 + (ref.is_null + (loop $label$13 (result anyref) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (local.tee $4 + (loop $label$14 (result anyref) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (local.get $4) + ) + ) ) ) ) ) ) ) + (f64.const 2.0368363672810022e-260) ) ) - ) - ) - (return - (local.get $4) - ) - ) - ) - (func $func_20_invoker - (drop - (call $func_20 - (ref.null) - (ref.func $func_12) - (ref.null) - ) - ) - ) - (func $func_22 (param $0 exnref) (param $1 nullref) (result funcref anyref nullref anyref i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.func $func_14_invoker) - (ref.null) - (ref.null) - (ref.null) - (i64.const -32768) + (br_if $label$1 + (loop $label$3 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$4 + (block $label$5 + (nop) + (drop + (f32.convert_i64_u + (i64.const 1394725084389383962) + ) + ) + (br_if $label$3 + (i32.eqz + (if (result i32) + (i32.eqz + (if (result i32) + (i32.eqz + (i32.and + (global.get $global$3) + (i32.const 15) + ) + ) + (if (result i32) + (i32.eqz + (i32.load16_u offset=3 align=1 + (i32.and + (i32.and + (global.get $global$3) + (i32.const 15) + ) + (i32.const 15) + ) + ) + ) + (i32.and + (global.get $global$3) + (i32.const 15) + ) + (loop $label$18 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (block $label$19 + (loop $label$20 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (nop) + ) + (br_if $label$19 + (i32.eqz + (local.get $3) + ) + ) + ) + (br_if $label$18 + (local.get $3) + ) + (local.get $3) + ) + ) + ) + (block $label$21 + (br $label$1) + ) + ) + ) + (ref.is_null + (ref.null) + ) + (block $label$22 + (v128.store offset=4 + (i32.and + (local.tee $3 + (i32.const 0) + ) + (i32.const 15) + ) + (i8x16.narrow_i16x8_u + (if (result v128) + (i32.eqz + (block $label$23 (result i32) + (i32.const -129) + ) + ) + (block $label$24 + (return + (local.get $4) + ) + ) + (v128.const i32x4 0xffffc000 0xffffffe0 0x00007fff 0x737f197a) + ) + (v128.const i32x4 0x10000000 0x00000000 0x00000080 0x00000000) + ) + ) + (br $label$1) + ) + ) + ) + ) + ) + (return + (local.get $4) + ) + ) + ) ) + (nop) ) ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result nullref nullref nullref nullref i64) - (block $label$1 (result nullref nullref nullref nullref i64) - (call $log-i64 - (i64.const -9223372036854775808) - ) - (tuple.make - (ref.null) - (ref.null) - (ref.null) - (ref.null) - (i64.const 1024) - ) - ) - ) - ) - (func $func_22_invoker - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_24 (param $0 f64) (result i32) - (local $1 f64) - (local $2 exnref) - (local $3 f32) - (local $4 v128) - (local $5 (exnref f32 f32 f32 i32)) - (local $6 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (i32.const -2147483647) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (i32.const -2147483647) - ) - ) - ) - (func $func_24_invoker - (drop - (call $func_24 - (f64.const 3.0737861764336346e-236) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_26 (param $0 funcref) (param $1 funcref) (param $2 anyref) (param $3 anyref) (param $4 nullref) (result f64) - (local $5 i64) - (local $6 exnref) - (local $7 (funcref f64)) - (local $8 f32) - (local $9 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 8.160763227260461e-259) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result f64) (nop) - (f64.const 3402823466385288598117041e14) - ) - ) - (func $func_26_invoker - (drop - (call $func_26 - (ref.null) - (ref.func $func_22_invoker) - (ref.null) - (ref.null) - (ref.null) - ) + (local.get $4) ) ) - (func $func_28 (param $0 nullref) (result f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 3.859060993302007e-86) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f64.const 2147483649) - ) - (func $func_29 (param $0 i32) (param $1 nullref) (param $2 funcref) (result nullref) + (func $func_9 (param $0 f64) (result nullref) + (local $1 nullref) + (local $2 f32) + (local $3 anyref) + (local $4 exnref) (block (if (i32.eqz @@ -874,188 +613,31 @@ ) ) ) - (block $label$0 - (nop) - (return - (local.get $1) - ) - ) + (local.get $1) ) - (func $func_29_invoker - (drop - (call $func_29 - (i32.const 2147483647) - (ref.null) - (ref.func $func_22_invoker) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_29 - (i32.const -65535) - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_31 (param $0 f32) (result funcref i32 i64 nullref v128) - (local $1 i64) - (local $2 (f32 f32)) + (func $func_10 (param $0 f32) (result f64) + (local $1 anyref) + (local $2 v128) (local $3 i32) - (local $4 i64) - (local $5 v128) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.func $func_24_invoker) - (i32.const 262144) - (i64.const 5580322043939276866) - (ref.null) - (v128.const i32x4 0x5e00164d 0x2c4108ff 0x0000f83a 0x00000400) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (tuple.make - (ref.null) - (i32.const 268435456) - (i64.const 6944553142512654410) - (ref.null) - (v128.const i32x4 0x7fffffff 0x00000000 0x00006444 0x00000000) - ) - ) - ) - ) - (func $func_32 (param $0 f32) (param $1 f32) (result f32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $1) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f32.const 6.785077194130481e-28) - ) - (func $func_33 (param $0 v128) (param $1 exnref) (param $2 v128) (param $3 v128) (param $4 anyref) (param $5 funcref) (param $6 anyref) (result nullref) - (local $7 anyref) - (local $8 (nullref nullref)) - (local $9 f64) - (local $10 nullref) - (local $11 nullref) - (local $12 i64) - (local $13 exnref) - (local $14 exnref) - (local $15 anyref) - (local $16 f32) - (local $17 f32) - (local $18 f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (local.get $10) - ) - ) - ) - (func $func_33_invoker - (drop - (call $func_33 - (v128.const i32x4 0x80000001 0xffffff81 0xffff8000 0xfffffff0) - (ref.null) - (v128.const i32x4 0x46457378 0xffe0ffb8 0x0f0e0000 0x00807fff) - (v128.const i32x4 0x0f10001c 0x004a5b09 0x3722594b 0x53000000) - (ref.null) - (ref.null) - (ref.null) - ) - ) - ) - (func $func_35 (result f64) - (local $0 f32) - (local $1 v128) - (local $2 funcref) - (local $3 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const -nan:0xfffffffffffb3) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f64.const 2.6233847629195463e-33) - ) - (func $func_35_invoker - (drop - (call $func_35) - ) - ) - (func $func_37 (result f64) - (local $0 (f32 funcref f64 exnref anyref)) - (local $1 v128) - (local $2 anyref) - (local $3 nullref) - (local $4 i64) - (local $5 (v128 anyref v128 funcref)) - (local $6 funcref) - (local $7 exnref) + (local $4 v128) + (local $5 funcref) + (local $6 f64) + (local $7 v128) + (local $8 f32) + (local $9 nullref) + (local $10 exnref) + (local $11 exnref) + (local $12 anyref) + (local $13 nullref) + (local $14 (v128 i32 exnref v128)) + (local $15 i64) (block (if (i32.eqz (global.get $hangLimit) ) (return - (f64.const 68) + (local.get $6) ) ) (global.set $hangLimit @@ -1065,63 +647,20 @@ ) ) ) - (block $label$0 (result f64) - (call $log-exnref - (local.tee $7 - (local.tee $7 - (ref.null) - ) - ) - ) - (f64.const 8.203050004426016e-158) - ) - ) - (func $func_37_invoker - (drop - (call $func_37) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_37) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_37) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_37) - ) - ) - (func $func_39 (param $0 f64) (param $1 anyref) (result i32) - (local $2 v128) - (block - (if + (select + (local.get $6) + (local.get $6) + (if (result i32) (i32.eqz - (global.get $hangLimit) - ) - (return - (i32.const 67108864) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) + (local.get $3) ) + (i32.const -2147483648) + (local.get $3) ) ) - (i32.const 981413694) ) - (func $func_40 (result i32 i32 f32 exnref nullref) - (local $0 i64) - (local $1 i64) + (func $func_11 (result i64 v128 f32 v128 v128) + (local $0 (v128 f32 f64 f64 f32)) (block (if (i32.eqz @@ -1129,11 +668,11 @@ ) (return (tuple.make - (i32.const 2147483647) - (i32.const -32768) - (f32.const -9223372036854775808) - (ref.null) - (ref.null) + (i64.const 1250326222040357399) + (v128.const i32x4 0x616a003f 0x8000ff02 0xffa20040 0x7fff5750) + (f32.const -3402823466385288598117041e14) + (v128.const i32x4 0x0400ff81 0x16168000 0x04000004 0x00000502) + (v128.const i32x4 0x010e0007 0x04020e0f 0xc7000000 0xcf000000) ) ) ) @@ -1148,37 +687,31 @@ (nop) (return (tuple.make - (i32.const -30) - (i32.const 12) - (f32.const -9223372036854775808) - (ref.null) - (ref.null) + (i64.const -20) + (v128.const i32x4 0x7fffffff 0x00000000 0x00000000 0xffffff80) + (f32.const -562949953421312) + (v128.const i32x4 0x7fffffff 0x00000000 0x00000000 0xffffff80) + (v128.const i32x4 0x0aff170d 0x490b3100 0x01800055 0x20004200) ) ) ) ) - (func $func_40_invoker - (drop - (call $func_40) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_42 (result funcref f64 i32 anyref anyref) + (func $func_12 (param $0 i64) (param $1 v128) (result f32) + (local $2 (exnref i32 nullref exnref nullref f64)) + (local $3 i32) + (local $4 i64) + (local $5 f32) + (local $6 i64) + (local $7 f32) + (local $8 nullref) + (local $9 f64) (block (if (i32.eqz (global.get $hangLimit) ) (return - (tuple.make - (ref.func $func_16) - (f64.const 1048576) - (i32.const 1294952226) - (ref.null) - (ref.null) - ) + (f32.const 57) ) ) (global.set $hangLimit @@ -1188,51 +721,8 @@ ) ) ) - (loop $label$0 (result nullref f64 i32 nullref nullref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.func $log-nullref) - (f64.const 2312) - (i32.const 1364292894) - (ref.null) - (ref.null) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result nullref f64 i32 nullref nullref) - (block $label$1 - (call $log-i32 - (call $hashMemory) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (br_if $label$0 - (i32.eqz - (i32.const 536870912) - ) - ) - (tuple.make - (ref.null) - (f64.const 1.0642378617897867e-234) - (i32.const -4096) - (ref.null) - (ref.null) - ) - ) + (return + (f32.const 6.254571977675003e-36) ) ) (func $hangLimitInitializer diff --git a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt index 36905f66d..d024a75ed 100644 --- a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt +++ b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt @@ -1,35 +1,16 @@ (module (type $none_=>_none (func)) (type $i64_=>_none (func (param i64))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_f64 (func (result f64))) - (type $none_=>_nullref_nullref_nullref_nullref_i64 (func (result nullref nullref nullref nullref i64))) (type $i32_=>_none (func (param i32))) (type $f32_=>_none (func (param f32))) (type $f64_=>_none (func (param f64))) (type $v128_=>_none (func (param v128))) (type $nullref_=>_none (func (param nullref))) (type $exnref_=>_none (func (param exnref))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $nullref_funcref_i64_=>_i64 (func (param nullref funcref i64) (result i64))) + (type $none_=>_i32 (func (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f64_=>_f64 (func (param f64) (result f64))) - (type $funcref_funcref_anyref_anyref_nullref_=>_f64 (func (param funcref funcref anyref anyref nullref) (result f64))) - (type $nullref_=>_f64 (func (param nullref) (result f64))) - (type $none_=>_v128 (func (result v128))) - (type $none_=>_funcref_i32_i64_nullref_v128 (func (result funcref i32 i64 nullref v128))) - (type $f32_=>_funcref_i32_i64_nullref_v128 (func (param f32) (result funcref i32 i64 nullref v128))) - (type $none_=>_funcref_anyref_nullref_anyref_i64 (func (result funcref anyref nullref anyref i64))) - (type $exnref_nullref_=>_funcref_anyref_nullref_anyref_i64 (func (param exnref nullref) (result funcref anyref nullref anyref i64))) - (type $none_=>_funcref_nullref (func (result funcref nullref))) - (type $exnref_f32_=>_funcref_nullref (func (param exnref f32) (result funcref nullref))) (type $none_=>_anyref (func (result anyref))) - (type $none_=>_nullref (func (result nullref))) - (type $i32_nullref_funcref_=>_nullref (func (param i32 nullref funcref) (result nullref))) - (type $v128_=>_nullref (func (param v128) (result nullref))) - (type $v128_exnref_v128_v128_anyref_funcref_anyref_=>_nullref (func (param v128 exnref v128 v128 anyref funcref anyref) (result nullref))) - (type $nullref_funcref_anyref_=>_exnref (func (param nullref funcref anyref) (result exnref))) (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) (import "fuzzing-support" "log-i64" (func $log-i64 (param i64))) (import "fuzzing-support" "log-f32" (func $log-f32 (param f32))) @@ -37,10 +18,9 @@ (import "fuzzing-support" "log-v128" (func $log-v128 (param v128))) (import "fuzzing-support" "log-nullref" (func $log-nullref (param nullref))) (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref))) - (memory $0 1 1) + (memory $0 (shared 1 1)) (data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3") - (table $0 8 8 funcref) - (elem (i32.const 0) $func_22 $func_26 $func_26 $func_26 $func_26 $func_29 $func_31 $func_33) + (table $0 0 funcref) (global $global$5 (mut f32) (f32.const 74)) (global $global$4 (mut nullref) (ref.null)) (global $global$3 (mut i32) (i32.const 1263230471)) @@ -55,29 +35,6 @@ (event $event$1 (attr 0) (param)) (export "hashMemory" (func $hashMemory)) (export "memory" (memory $0)) - (export "func_8" (func $func_8)) - (export "func_8_invoker" (func $func_8_invoker)) - (export "func_10_invoker" (func $func_10_invoker)) - (export "func_12_invoker" (func $func_12_invoker)) - (export "func_14_invoker" (func $func_14_invoker)) - (export "func_16" (func $func_16)) - (export "func_16_invoker" (func $func_16_invoker)) - (export "func_19" (func $func_19)) - (export "func_20" (func $func_20)) - (export "func_20_invoker" (func $func_20_invoker)) - (export "func_22_invoker" (func $func_22_invoker)) - (export "func_24" (func $func_24)) - (export "func_24_invoker" (func $func_24_invoker)) - (export "func_26" (func $func_26)) - (export "func_26_invoker" (func $func_26_invoker)) - (export "func_29" (func $func_29)) - (export "func_29_invoker" (func $func_29_invoker)) - (export "func_31" (func $func_31)) - (export "func_32" (func $func_32)) - (export "func_33_invoker" (func $func_33_invoker)) - (export "func_35_invoker" (func $func_35_invoker)) - (export "func_37" (func $func_37)) - (export "func_37_invoker" (func $func_37_invoker)) (export "hangLimitInitializer" (func $hangLimitInitializer)) (func $hashMemory (result i32) (local $0 i32) @@ -324,68 +281,6 @@ (global.get $hangLimit) ) (return - (local.get $4) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (loop $label$1 - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block - (nop) - (br_if $label$1 - (i32.eqz - (i32.const -8) - ) - ) - (nop) - ) - ) - (return - (local.get $4) - ) - ) - ) - (func $func_8_invoker - (drop - (call $func_8) - ) - (drop - (call $func_8) - ) - (drop - (call $func_8) - ) - ) - (func $func_10 (result nullref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return (ref.null) ) ) @@ -396,7 +291,7 @@ ) ) ) - (block $label$0 + (block $label$0 (result anyref) (loop $label$1 (block (if @@ -414,763 +309,138 @@ ) ) ) - (br_if $label$1 - (i32.eqz - (i32.const 5) - ) - ) - ) - (return - (ref.null) - ) - ) - ) - (func $func_10_invoker - (drop - (call $func_10) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_12 (param $0 exnref) (param $1 f32) (result funcref nullref) - (local $2 f32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.null) - (ref.null) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (tuple.make - (ref.null) - (ref.null) - ) - ) - (func $func_12_invoker - (drop - (call $func_12 - (ref.null) - (f32.const 0) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_12 - (ref.null) - (f32.const 18446744073709551615) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_14 (result v128) - (local $0 i64) - (local $1 i32) - (local $2 f64) - (local $3 f64) - (local $4 f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (v128.const i32x4 0xffffff01 0xffffffff 0x4e484e45 0x00000000) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (v128.const i32x4 0x00000000 0xc2800000 0x00000000 0x4eb61298) - ) - (func $func_14_invoker - (drop - (call $func_14) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_14) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_16 - (local $0 exnref) - (local $1 f32) - (local $2 i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (nop) - ) - (func $func_16_invoker - (call $func_16) - ) - (func $func_18 (param $0 v128) (result nullref) - (local $1 i64) - (local $2 v128) - (local $3 i32) - (local $4 nullref) - (local $5 anyref) - (local $6 f64) - (local $7 (exnref anyref exnref)) - (local $8 f32) - (local $9 (i32 v128)) - (local $10 i32) - (local $11 (f64 exnref v128 f64 f32 v128)) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $4) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (ref.null) - ) - (func $func_19 (result i32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (i32.const 18233) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (i32.const 24) - ) - (func $func_20 (param $0 nullref) (param $1 funcref) (param $2 anyref) (result exnref) - (local $3 funcref) - (local $4 exnref) - (local $5 i32) - (local $6 funcref) - (local $7 (i64 i32 v128 f32 f64)) - (local $8 f32) - (local $9 v128) - (local $10 v128) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $4) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (call $log-i32 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (local.tee $5 - (loop $label$1 (result i32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $4) + (block + (block $label$2 + (atomic.fence) + (f64.store offset=3 align=2 + (i32.and + (i32.const 521278814) + (block $label$9 (result i32) + (drop + (tuple.make + (f32.const -16777216) + (ref.null) + (ref.null) + ) + ) + (i32.gt_u + (block $label$12 (result i32) + (if + (local.get $3) + (nop) + (nop) + ) + (local.get $3) + ) + (local.tee $3 + (ref.is_null + (loop $label$13 (result anyref) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) + (local.tee $4 + (loop $label$14 (result anyref) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (local.get $4) + ) ) ) ) - (block $label$2 (result i32) - (local.tee $5 - (i32.const 12588) - ) - ) ) ) ) ) + (f64.const 2.0368363672810022e-260) ) ) - ) - ) - (return - (local.get $4) - ) - ) - ) - (func $func_20_invoker - (drop - (call $func_20 - (ref.null) - (ref.func $func_12) - (ref.null) - ) - ) - ) - (func $func_22 (param $0 exnref) (param $1 nullref) (result funcref anyref nullref anyref i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.func $func_14_invoker) - (ref.null) - (ref.null) - (ref.null) - (i64.const -32768) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result nullref nullref nullref nullref i64) - (block $label$1 (result nullref nullref nullref nullref i64) - (call $log-i64 - (i64.const -9223372036854775808) - ) - (tuple.make - (ref.null) - (ref.null) - (ref.null) - (ref.null) - (i64.const 1024) - ) - ) - ) - ) - (func $func_22_invoker - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (drop - (call $func_22 - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_24 (param $0 f64) (result i32) - (local $1 f64) - (local $2 exnref) - (local $3 f32) - (local $4 v128) - (local $5 (exnref f32 f32 f32 i32)) - (local $6 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (i32.const -2147483647) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (i32.const -2147483647) - ) - ) - ) - (func $func_24_invoker - (drop - (call $func_24 - (f64.const 3.0737861764336346e-236) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_26 (param $0 funcref) (param $1 funcref) (param $2 anyref) (param $3 anyref) (param $4 nullref) (result f64) - (local $5 i64) - (local $6 exnref) - (local $7 (funcref f64)) - (local $8 f32) - (local $9 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 8.160763227260461e-259) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result f64) - (nop) - (f64.const 3402823466385288598117041e14) - ) - ) - (func $func_26_invoker - (drop - (call $func_26 - (ref.null) - (ref.func $func_22_invoker) - (ref.null) - (ref.null) - (ref.null) - ) - ) - ) - (func $func_28 (param $0 nullref) (result f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 3.859060993302007e-86) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f64.const 2147483649) - ) - (func $func_29 (param $0 i32) (param $1 nullref) (param $2 funcref) (result nullref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (local.get $1) - ) - ) - ) - (func $func_29_invoker - (drop - (call $func_29 - (i32.const 2147483647) - (ref.null) - (ref.func $func_22_invoker) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_29 - (i32.const -65535) - (ref.null) - (ref.null) - ) - ) - (call $log-i32 - (call $hashMemory) - ) - ) - (func $func_31 (param $0 f32) (result funcref i32 i64 nullref v128) - (local $1 i64) - (local $2 (f32 f32)) - (local $3 i32) - (local $4 i64) - (local $5 v128) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (tuple.make - (ref.func $func_24_invoker) - (i32.const 262144) - (i64.const 5580322043939276866) - (ref.null) - (v128.const i32x4 0x5e00164d 0x2c4108ff 0x0000f83a 0x00000400) - ) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (tuple.make - (ref.null) - (i32.const 268435456) - (i64.const 6944553142512654410) - (ref.null) - (v128.const i32x4 0x7fffffff 0x00000000 0x00006444 0x00000000) - ) - ) - ) - ) - (func $func_32 (param $0 f32) (param $1 f32) (result f32) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $1) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f32.const 6.785077194130481e-28) - ) - (func $func_33 (param $0 v128) (param $1 exnref) (param $2 v128) (param $3 v128) (param $4 anyref) (param $5 funcref) (param $6 anyref) (result nullref) - (local $7 anyref) - (local $8 (nullref nullref)) - (local $9 f64) - (local $10 nullref) - (local $11 nullref) - (local $12 i64) - (local $13 exnref) - (local $14 exnref) - (local $15 anyref) - (local $16 f32) - (local $17 f32) - (local $18 f64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (ref.null) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 - (nop) - (return - (local.get $10) - ) - ) - ) - (func $func_33_invoker - (drop - (call $func_33 - (v128.const i32x4 0x80000001 0xffffff81 0xffff8000 0xfffffff0) - (ref.null) - (v128.const i32x4 0x46457378 0xffe0ffb8 0x0f0e0000 0x00807fff) - (v128.const i32x4 0x0f10001c 0x004a5b09 0x3722594b 0x53000000) - (ref.null) - (ref.null) - (ref.null) - ) - ) - ) - (func $func_35 (result f64) - (local $0 f32) - (local $1 v128) - (local $2 funcref) - (local $3 anyref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 0) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (f64.const 2.6233847629195463e-33) - ) - (func $func_35_invoker - (drop - (call $func_35) - ) - ) - (func $func_37 (result f64) - (local $0 (f32 funcref f64 exnref anyref)) - (local $1 v128) - (local $2 anyref) - (local $3 nullref) - (local $4 i64) - (local $5 (v128 anyref v128 funcref)) - (local $6 funcref) - (local $7 exnref) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (f64.const 1799288964632556427869339e121) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result f64) - (call $log-exnref - (local.tee $7 - (local.tee $7 - (ref.null) - ) - ) - ) - (call $deNan64 - (f64.reinterpret_i64 - (local.get $4) - ) - ) - ) - ) - (func $func_37_invoker - (drop - (call $func_37) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_37) - ) - (call $log-i32 - (call $hashMemory) - ) - (drop - (call $func_37) - ) - (drop - (call $func_37) - ) - ) - (func $func_39 (param $0 nullref) (param $1 funcref) (param $2 i64) (result i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (local.get $2) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result i64) - (nop) - (loop $label$1 (result i64) - (block - (if - (i32.eqz - (global.get $hangLimit) - ) - (return - (i64.const -536870912) - ) - ) - (global.set $hangLimit - (i32.sub - (global.get $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i64) - (block $label$2 - (local.set $2 - (i64.const -2097152) - ) - (if - (i32.eqz - (i32.const -2048) - ) - (block $label$3 + (br_if $label$1 + (loop $label$3 + (block (if (i32.eqz - (i32.const -1) + (global.get $hangLimit) + ) + (return + (local.get $4) ) - (nop) - (nop) ) - (local.set $2 - (if (result i64) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$4 + (block $label$5 + (nop) + (drop + (global.get $global$5) + ) + (br_if $label$3 (i32.eqz - (i32.const 12) - ) - (block $label$4 (result i64) - (local.set $0 - (if (result nullref) - (i32.const -2147483648) - (block $label$5 (result nullref) - (i64.store8 offset=22 + (if (result i32) + (i32.eqz + (if (result i32) + (i32.eqz (if (result i32) (i32.eqz - (loop $label$6 (result i32) + (select + (block $label$7 (result i32) + (nop) + (local.tee $3 + (block $label$8 (result i32) + (nop) + (local.get $3) + ) + ) + ) + (local.get $3) + (block $label$6 + (return + (local.get $4) + ) + ) + ) + ) + (i32.const -95) + (select + (loop $label$25 (result i32) (block (if (i32.eqz (global.get $hangLimit) ) (return - (i64.const 8) + (ref.null) ) ) (global.set $hangLimit @@ -1181,17 +451,127 @@ ) ) (block (result i32) - (if - (i32.const 319888671) - (nop) - (loop $label$7 + (block $label$26 + (block $label$27 + (local.set $4 + (local.get $4) + ) + (call $log-i64 + (select + (local.tee $0 + (i64.atomic.load32_u offset=22 + (i32.and + (i32.const -4) + (i32.const 15) + ) + ) + ) + (i64.extend_i32_s + (i32.load16_u offset=22 + (i32.and + (i32.extend8_s + (global.get $global$2) + ) + (i32.const 15) + ) + ) + ) + (i32.atomic.load + (i32.and + (loop $label$28 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (block $label$29 + (block $label$30 + (memory.copy + (i32.and + (local.tee $3 + (i64.le_s + (select + (local.get $0) + (i64.const 2147483647) + (local.get $3) + ) + (i64.const 29050) + ) + ) + (i32.const 15) + ) + (i32.and + (local.get $3) + (i32.const 15) + ) + (global.get $global$3) + ) + ) + (f64.store offset=22 align=2 + (i32.and + (i32.const -65535) + (i32.const 15) + ) + (block $label$31 (result f64) + (if + (block $label$32 + (nop) + (br $label$29) + ) + (i64.atomic.store32 offset=4 + (i32.const 1291) + (block $label$33 + (local.set $3 + (i32.const 122572612) + ) + (br $label$27) + ) + ) + (block $label$34 + (atomic.fence) + ) + ) + (f64.load offset=2 align=1 + (i32.and + (local.get $3) + (i32.const 15) + ) + ) + ) + ) + ) + (br_if $label$28 + (i32.const -59) + ) + (local.get $3) + ) + ) + (i32.const 15) + ) + ) + ) + ) + ) + (loop $label$43 (block (if (i32.eqz (global.get $hangLimit) ) (return - (local.get $2) + (ref.null) ) ) (global.set $hangLimit @@ -1202,61 +582,736 @@ ) ) (block - (local.set $1 - (local.get $1) + (br_if $label$25 + (i32.eqz + (if (result i32) + (i32.eqz + (atomic.notify offset=22 + (i32.and + (ref.is_null + (ref.func $log-f32) + ) + (i32.const 15) + ) + (local.tee $3 + (local.get $3) + ) + ) + ) + (block $label$44 + (nop) + (br $label$26) + ) + (block $label$45 (result i32) + (loop $label$46 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$47 + (local.set $5 + (block $label$48 (result nullref) + (i64.atomic.store32 offset=4 + (i32.and + (global.get $global$2) + (i32.const 15) + ) + (local.tee $0 + (i64.const -95) + ) + ) + (ref.null) + ) + ) + (call $log-nullref + (block $label$49 + (loop $label$50 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (br_if $label$50 + (i32.eqz + (global.get $global$3) + ) + ) + (br_if $label$50 + (i32.eqz + (local.get $3) + ) + ) + (br_if $label$26 + (i32.eqz + (if (result i32) + (i32.eqz + (local.get $3) + ) + (i32.const -2147483648) + (i32.const 1783516750) + ) + ) + ) + ) + ) + (br $label$46) + ) + ) + ) + ) + (loop $label$51 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (if + (local.get $3) + (loop $label$52 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$53 + (loop $label$54 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (v128.store offset=4 align=4 + (local.get $3) + (v128.const i32x4 0x00000045 0x00000000 0x170e0b00 0x00000000) + ) + (br_if $label$54 + (i32.eqz + (select + (i32.const -1024) + (local.get $3) + (i32.const -69) + ) + ) + ) + (block $label$55 + (if + (global.get $global$3) + (loop $label$56 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (nop) + (br_if $label$56 + (i32.const 20266) + ) + (br_if $label$25 + (i32.eqz + (ref.is_null + (ref.null) + ) + ) + ) + ) + ) + (nop) + ) + (local.set $3 + (i32.le_s + (local.get $3) + (loop $label$57 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (local.get $3) + ) + ) + ) + ) + ) + ) + (local.set $3 + (block $label$58 (result i32) + (nop) + (local.get $3) + ) + ) + ) + ) + (block $label$59 + (nop) + (if + (i32.eqz + (loop $label$60 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$61 + (local.set $1 + (local.get $1) + ) + (br $label$51) + ) + ) + ) + (loop $label$62 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (loop $label$63 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (drop + (ref.null) + ) + (br_if $label$63 + (i32.eqz + (local.get $3) + ) + ) + (if + (i32.eqz + (loop $label$64 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (local.get $3) + ) + ) + (i64.store8 offset=3 + (i32.and + (local.tee $3 + (local.get $3) + ) + (i32.const 15) + ) + (i64.const 4920830541588677956) + ) + (local.set $4 + (local.tee $4 + (local.get $4) + ) + ) + ) + ) + ) + ) + (local.set $3 + (if (result i32) + (i32.eqz + (if (result i32) + (i32.eqz + (local.get $3) + ) + (i32.const -262144) + (br_if $label$45 + (local.get $3) + (i32.const -126) + ) + ) + ) + (if (result i32) + (local.get $3) + (i32.const -4096) + (local.get $3) + ) + (local.get $3) + ) + ) + ) + ) + ) + (br_if $label$51 + (i32.eqz + (if (result i32) + (i32.eqz + (i8x16.extract_lane_u 6 + (if (result v128) + (i32.const 32767) + (if (result v128) + (local.get $3) + (i64x2.splat + (loop $label$65 (result i64) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (i64.const 126) + ) + ) + (v128.const i32x4 0x0100007a 0x1d4cba00 0x00002000 0x00001200) + ) + (block $label$66 + (if + (i32.eqz + (if (result i32) + (i32.eqz + (block $label$67 + (local.set $4 + (ref.null) + ) + (br $label$26) + ) + ) + (local.get $3) + (i32.const 4096) + ) + ) + (nop) + (i64.atomic.store8 offset=4 + (i32.and + (global.get $global$2) + (i32.const 15) + ) + (i64.const -128) + ) + ) + (br $label$51) + ) + ) + ) + ) + (block $label$68 + (nop) + (br $label$51) + ) + (block $label$69 (result i32) + (nop) + (br_if $label$69 + (ref.is_null + (local.tee $4 + (ref.null) + ) + ) + (i32.eqz + (i32.eqz + (local.get $3) + ) + ) + ) + ) + ) + ) + ) + (local.get $3) + ) + ) + ) + ) + ) ) - (br_if $label$7 - (i32.const 65535) + (br_if $label$43 + (i32.eqz + (if (result i32) + (i32.eqz + (local.tee $3 + (i16x8.extract_lane_s 6 + (v8x16.shuffle 8 11 19 17 15 16 14 19 17 15 16 14 19 17 15 16 + (loop $label$70 (result v128) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result v128) + (block $label$71 + (memory.fill + (i32.and + (if (result i32) + (local.get $3) + (local.get $3) + (local.get $3) + ) + (i32.const 15) + ) + (i32.and + (i32.const 72) + (i32.const 15) + ) + (if (result i32) + (loop $label$72 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (atomic.notify offset=22 + (i32.and + (i32.const 168631327) + (i32.const 15) + ) + (local.get $3) + ) + ) + (i32.const 102434061) + (local.get $3) + ) + ) + (block $label$73 + (i64.store offset=22 align=4 + (i32.and + (local.get $3) + (i32.const 15) + ) + (local.get $0) + ) + (if + (local.get $3) + (local.set $6 + (f32.const 15197) + ) + (nop) + ) + ) + ) + (br_if $label$70 + (f64.gt + (if (result f64) + (select + (local.get $3) + (i32.const -2147483648) + (i32.const 52367877) + ) + (f64.const -18446744073709551615) + (f64.const 2.0587249864648059e-168) + ) + (f64.const 9.399829295721398e-187) + ) + ) + (v128.const i32x4 0x3423505b 0xffffffff 0x0203e000 0xffff1717) + ) + ) + (v128.const i32x4 0xa0358001 0x5337017f 0xff005bb3 0xffa80100) + ) + ) + ) + ) + (block $label$75 (result i32) + (local.get $3) + ) + (block $label$76 (result i32) + (local.get $3) + ) + ) + ) ) (nop) ) ) ) - (br_if $label$6 - (block $label$8 - (nop) - (br $label$1) + (br_if $label$25 + (i32.const -4) + ) + (i32.const 127) + ) + ) + (local.get $3) + (i32.load16_u offset=22 align=1 + (i32.and + (i64.ge_s + (local.tee $0 + (local.tee $0 + (local.get $0) + ) ) + (local.get $0) ) - (i32.const 32) + (i32.const 15) ) ) ) - (block $label$9 (result i32) - (i32.const 640426599) + ) + ) + (if (result i32) + (i32.eqz + (local.tee $3 + (i32.const -96) + ) + ) + (i64x2.all_true + (f32x4.splat + (call $deNan32 + (f32.convert_i64_u + (i64.const 1394725084389383962) + ) + ) + ) + ) + (loop $label$18 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $4) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (block $label$19 + (loop $label$20 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (nop) + ) + (br_if $label$19 + (i32.eqz + (local.get $3) + ) + ) + ) + (br_if $label$18 + (i32.eqz + (i32.atomic.load offset=3 + (local.get $3) + ) + ) + ) + (local.get $3) ) - (i32.const -127) ) - (i64.const 1178066318063523073) ) - (ref.null) + (block $label$21 + (br $label$1) + ) ) - (block $label$10 (result nullref) - (ref.null) + ) + (local.get $3) + (block $label$22 + (v128.store offset=4 + (i32.and + (i32.and + (global.get $global$3) + (i32.const 15) + ) + (i32.const 15) + ) + (i8x16.narrow_i16x8_u + (if (result v128) + (i32.eqz + (block $label$23 (result i32) + (i32.const -129) + ) + ) + (block $label$24 + (br $label$3) + ) + (v128.const i32x4 0xffffc000 0xffffffe0 0x00007fff 0x737f197a) + ) + (v128.const i32x4 0x10000000 0x00000000 0x00000080 0x00000000) + ) ) + (br $label$1) ) ) - (i64.const 268435456) - ) - (block $label$11 (result i64) - (local.get $2) ) ) ) + (return + (local.get $4) + ) ) - (block $label$12 - (nop) - ) - ) - ) - (br_if $label$1 - (i32.eqz - (i32.const 453924633) ) ) - (local.get $2) + (nop) ) ) + (nop) + (local.get $4) ) ) (func $hangLimitInitializer |