From 155d0b5f42b57100582649dfbdb81806b10579a2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 22 Jan 2018 17:36:06 -0800 Subject: Atomic wait/wake fixes (#1383) * fix wait and wake binary format support, they have alignments and offsets * don't emit unreachable parts of atomic operations, for simplicity and to avoid special handling * don't emit atomic waits by default in the fuzzer, they hang in native vm support --- src/tools/fuzzing.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/tools/fuzzing.h') diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 0b3dbf78e..19bff428e 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -174,6 +174,9 @@ private: // Whether to emit atomics static const bool ATOMICS = true; + // Whether to emit atomic waits (which in single-threaded mode, may hang...) + static const bool ATOMIC_WAITS = false; + // after we finish the input, we start going through it again, but xoring // so it's not identical int xorFactor = 0; @@ -1242,16 +1245,16 @@ private: if (!ATOMICS || (type != i32 && type != i64)) return makeTrivial(type); wasm.memory.shared = true; if (type == i32 && oneIn(2)) { - if (oneIn(2)) { + if (ATOMIC_WAITS && oneIn(2)) { auto* ptr = makePointer(); auto expectedType = pick(i32, i64); auto* expected = make(expectedType); auto* timeout = make(i64); - return builder.makeAtomicWait(ptr, expected, timeout, expectedType); + return builder.makeAtomicWait(ptr, expected, timeout, expectedType, logify(get())); } else { auto* ptr = makePointer(); auto* count = make(i32); - return builder.makeAtomicWake(ptr, count); + return builder.makeAtomicWake(ptr, count, logify(get())); } } Index bytes; -- cgit v1.2.3