Bug 1488698 - Always use braces for if/for/while statements in js/src/wasm, part 5. r=bbouvier
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 06 Sep 2018 11:26:23 +0200
changeset 435742 e3a9c003c9c5d3d6484fa88ba07bdd7c0ff183d5
parent 435741 20142eb6afd6c14610943833a5e7bdbceb4dfb8a
child 435743 817b7142d4d965f9ab591a33268e2a59d29e4aed
push id34618
push userbtara@mozilla.com
push dateTue, 11 Sep 2018 22:13:11 +0000
treeherdermozilla-central@1169e8a4ca2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1488698
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1488698 - Always use braces for if/for/while statements in js/src/wasm, part 5. r=bbouvier
js/src/wasm/WasmSerialize.h
js/src/wasm/WasmSignalHandlers.cpp
js/src/wasm/WasmStubs.cpp
js/src/wasm/WasmTable.cpp
js/src/wasm/WasmTextToBinary.cpp
js/src/wasm/WasmTypes.cpp
js/src/wasm/WasmTypes.h
js/src/wasm/WasmValidate.cpp
js/src/wasm/WasmValidate.h
--- a/js/src/wasm/WasmSerialize.h
+++ b/js/src/wasm/WasmSerialize.h
@@ -25,34 +25,37 @@ namespace js {
 namespace wasm {
 
 // Factor out common serialization, cloning and about:memory size-computation
 // functions for reuse when serializing wasm and asm.js modules.
 
 static inline uint8_t*
 WriteBytes(uint8_t* dst, const void* src, size_t nbytes)
 {
-    if (nbytes)
+    if (nbytes) {
         memcpy(dst, src, nbytes);
+    }
     return dst + nbytes;
 }
 
 static inline const uint8_t*
 ReadBytes(const uint8_t* src, void* dst, size_t nbytes)
 {
-    if (nbytes)
+    if (nbytes) {
         memcpy(dst, src, nbytes);
+    }
     return src + nbytes;
 }
 
 static inline const uint8_t*
 ReadBytesChecked(const uint8_t* src, size_t* remain, void* dst, size_t nbytes)
 {
-    if (*remain < nbytes)
+    if (*remain < nbytes) {
         return nullptr;
+    }
     memcpy(dst, src, nbytes);
     *remain -= nbytes;
     return src + nbytes;
 }
 
 template <class T>
 static inline uint8_t*
 WriteScalar(uint8_t* dst, T t)
@@ -68,66 +71,72 @@ ReadScalar(const uint8_t* src, T* dst)
     memcpy(dst, src, sizeof(*dst));
     return src + sizeof(*dst);
 }
 
 template <class T>
 static inline const uint8_t*
 ReadScalarChecked(const uint8_t* src, size_t* remain, T* dst)
 {
-    if (*remain < sizeof(*dst))
+    if (*remain < sizeof(*dst)) {
         return nullptr;
+    }
     memcpy(dst, src, sizeof(*dst));
     *remain -= sizeof(*dst);
     return src + sizeof(*dst);
 }
 
 template <class T, size_t N>
 static inline size_t
 SerializedVectorSize(const mozilla::Vector<T, N, SystemAllocPolicy>& vec)
 {
     size_t size = sizeof(uint32_t);
-    for (size_t i = 0; i < vec.length(); i++)
+    for (size_t i = 0; i < vec.length(); i++) {
         size += vec[i].serializedSize();
+    }
     return size;
 }
 
 template <class T, size_t N>
 static inline uint8_t*
 SerializeVector(uint8_t* cursor, const mozilla::Vector<T, N, SystemAllocPolicy>& vec)
 {
     cursor = WriteScalar<uint32_t>(cursor, vec.length());
-    for (size_t i = 0; i < vec.length(); i++)
+    for (size_t i = 0; i < vec.length(); i++) {
         cursor = vec[i].serialize(cursor);
+    }
     return cursor;
 }
 
 template <class T, size_t N>
 static inline const uint8_t*
 DeserializeVector(const uint8_t* cursor, mozilla::Vector<T, N, SystemAllocPolicy>* vec)
 {
     uint32_t length;
     cursor = ReadScalar<uint32_t>(cursor, &length);
-    if (!vec->resize(length))
+    if (!vec->resize(length)) {
         return nullptr;
+    }
     for (size_t i = 0; i < vec->length(); i++) {
-        if (!(cursor = (*vec)[i].deserialize(cursor)))
+        if (!(cursor = (*vec)[i].deserialize(cursor))) {
             return nullptr;
+        }
     }
     return cursor;
 }
 
 template <class T, size_t N>
 static inline size_t
 SizeOfVectorExcludingThis(const mozilla::Vector<T, N, SystemAllocPolicy>& vec,
                           MallocSizeOf mallocSizeOf)
 {
     size_t size = vec.sizeOfExcludingThis(mallocSizeOf);
-    for (const T& t : vec)
+    for (const T& t : vec) {
         size += t.sizeOfExcludingThis(mallocSizeOf);
+    }
     return size;
 }
 
 template <class T, size_t N>
 static inline size_t
 SerializedPodVectorSize(const mozilla::Vector<T, N, SystemAllocPolicy>& vec)
 {
     return sizeof(uint32_t) +
@@ -147,30 +156,32 @@ SerializePodVector(uint8_t* cursor, cons
 }
 
 template <class T, size_t N>
 static inline const uint8_t*
 DeserializePodVector(const uint8_t* cursor, mozilla::Vector<T, N, SystemAllocPolicy>* vec)
 {
     uint32_t length;
     cursor = ReadScalar<uint32_t>(cursor, &length);
-    if (!vec->initLengthUninitialized(length))
+    if (!vec->initLengthUninitialized(length)) {
         return nullptr;
+    }
     cursor = ReadBytes(cursor, vec->begin(), length * sizeof(T));
     return cursor;
 }
 
 template <class T, size_t N>
 static inline const uint8_t*
 DeserializePodVectorChecked(const uint8_t* cursor, size_t* remain, mozilla::Vector<T, N, SystemAllocPolicy>* vec)
 {
     uint32_t length;
     cursor = ReadScalarChecked<uint32_t>(cursor, remain, &length);
-    if (!cursor || !vec->initLengthUninitialized(length))
+    if (!cursor || !vec->initLengthUninitialized(length)) {
         return nullptr;
+    }
     cursor = ReadBytesChecked(cursor, remain, vec->begin(), length * sizeof(T));
     return cursor;
 }
 
 } // namespace wasm
 } // namespace js
 
 #endif // wasm_serialize_h
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -665,49 +665,52 @@ AddressOfGPRegisterSlot(CONTEXT* context
     MOZ_CRASH("NYI - asm.js not supported yet on this platform");
 }
 #endif
 
 MOZ_COLD static void
 SetRegisterToCoercedUndefined(CONTEXT* context, size_t size,
                               const Disassembler::OtherOperand& value)
 {
-    if (value.kind() == Disassembler::OtherOperand::FPR)
+    if (value.kind() == Disassembler::OtherOperand::FPR) {
         SetFPRegToNaN(size, AddressOfFPRegisterSlot(context, value.fpr()));
-    else
+    } else {
         SetGPRegToZero(AddressOfGPRegisterSlot(context, value.gpr()));
+    }
 }
 
 MOZ_COLD static void
 SetRegisterToLoadedValue(CONTEXT* context, SharedMem<void*> addr, size_t size,
                          const Disassembler::OtherOperand& value)
 {
-    if (value.kind() == Disassembler::OtherOperand::FPR)
+    if (value.kind() == Disassembler::OtherOperand::FPR) {
         SetFPRegToLoadedValue(addr, size, AddressOfFPRegisterSlot(context, value.fpr()));
-    else
+    } else {
         SetGPRegToLoadedValue(addr, size, AddressOfGPRegisterSlot(context, value.gpr()));
+    }
 }
 
 MOZ_COLD static void
 SetRegisterToLoadedValueSext32(CONTEXT* context, SharedMem<void*> addr, size_t size,
                                const Disassembler::OtherOperand& value)
 {
     SetGPRegToLoadedValueSext32(addr, size, AddressOfGPRegisterSlot(context, value.gpr()));
 }
 
 MOZ_COLD static void
 StoreValueFromRegister(CONTEXT* context, SharedMem<void*> addr, size_t size,
                        const Disassembler::OtherOperand& value)
 {
-    if (value.kind() == Disassembler::OtherOperand::FPR)
+    if (value.kind() == Disassembler::OtherOperand::FPR) {
         StoreValueFromFPReg(addr, size, AddressOfFPRegisterSlot(context, value.fpr()));
-    else if (value.kind() == Disassembler::OtherOperand::GPR)
+    } else if (value.kind() == Disassembler::OtherOperand::GPR) {
         StoreValueFromGPReg(addr, size, AddressOfGPRegisterSlot(context, value.gpr()));
-    else
+    } else {
         StoreValueFromGPImm(addr, size, value.imm());
+    }
 }
 
 MOZ_COLD static uint8_t*
 ComputeAccessAddress(CONTEXT* context, const Disassembler::ComplexAddress& address)
 {
     MOZ_RELEASE_ASSERT(!address.isPCRelative(), "PC-relative addresses not supported yet");
 
     uintptr_t result = address.disp();
@@ -737,18 +740,19 @@ HandleOutOfBounds(CONTEXT* context, uint
                   uint8_t** ppc)
 {
     MOZ_RELEASE_ASSERT(segment->code().containsCodePC(pc));
 
     Trap trap;
     BytecodeOffset bytecode;
     MOZ_ALWAYS_TRUE(segment->code().lookupTrap(pc, &trap, &bytecode));
 
-    if (trap != Trap::OutOfBounds)
+    if (trap != Trap::OutOfBounds) {
         return false;
+    }
 
     if (bytecode.isValid()) {
         activation->startWasmTrap(Trap::OutOfBounds, bytecode.offset(), ToRegisterState(context));
         *ppc = segment->trapCode();
         return true;
     }
 
 #ifndef WASM_HUGE_MEMORY
@@ -905,66 +909,73 @@ HandleFault(PEXCEPTION_POINTERS exceptio
     {
         return false;
     }
 
     uint8_t** ppc = ContextToPC(context);
     uint8_t* pc = *ppc;
 
     const CodeSegment* codeSegment = LookupCodeSegment(pc);
-    if (!codeSegment || !codeSegment->isModule())
+    if (!codeSegment || !codeSegment->isModule()) {
         return false;
+    }
 
     const ModuleSegment* moduleSegment = codeSegment->asModule();
 
     JitActivation* activation = TlsContext.get()->activation()->asJit();
     MOZ_ASSERT(activation);
 
     const Instance* instance = LookupFaultingInstance(*moduleSegment, pc, ContextToFP(context));
-    if (!instance)
+    if (!instance) {
         return false;
+    }
 
     if (record->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) {
         Trap trap;
         BytecodeOffset bytecode;
-        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode))
+        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode)) {
             return false;
+        }
 
         activation->startWasmTrap(trap, bytecode.offset(), ToRegisterState(context));
         *ppc = moduleSegment->trapCode();
         return true;
     }
 
     MOZ_RELEASE_ASSERT(&instance->code() == &moduleSegment->code());
 
-    if (record->NumberParameters < 2)
+    if (record->NumberParameters < 2) {
         return false;
+    }
 
     uint8_t* faultingAddress = reinterpret_cast<uint8_t*>(record->ExceptionInformation[1]);
 
     // This check isn't necessary, but, since we can, check anyway to make
     // sure we aren't covering up a real bug.
-    if (!IsHeapAccessAddress(*instance, faultingAddress))
+    if (!IsHeapAccessAddress(*instance, faultingAddress)) {
         return false;
+    }
 
     MOZ_ASSERT(activation->compartment() == instance->realm()->compartment());
 
     return HandleOutOfBounds(context, pc, faultingAddress, moduleSegment, *instance, activation, ppc);
 }
 
 static LONG WINAPI
 WasmFaultHandler(LPEXCEPTION_POINTERS exception)
 {
     // Before anything else, prevent handler recursion.
-    if (sAlreadyInSignalHandler.get())
+    if (sAlreadyInSignalHandler.get()) {
         return EXCEPTION_CONTINUE_SEARCH;
+    }
     AutoSignalHandler ash;
 
-    if (HandleFault(exception))
+    if (HandleFault(exception)) {
         return EXCEPTION_CONTINUE_EXECUTION;
+    }
 
     // No need to worry about calling other handlers, the OS does this for us.
     return EXCEPTION_CONTINUE_SEARCH;
 }
 
 #elif defined(XP_DARWIN)
 # include <mach/exc.h>
 
@@ -1016,82 +1027,92 @@ HandleMachException(JSContext* cx, const
     int thread_state = ARM_THREAD_STATE;
     int float_state = ARM_NEON_STATE;
 # else
 #  error Unsupported architecture
 # endif
     kern_return_t kret;
     kret = thread_get_state(cxThread, thread_state,
                             (thread_state_t)&context.thread, &thread_state_count);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
     kret = thread_get_state(cxThread, float_state,
                             (thread_state_t)&context.float_, &float_state_count);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
 
     uint8_t** ppc = ContextToPC(&context);
     uint8_t* pc = *ppc;
 
     if (request.body.exception != EXC_BAD_ACCESS &&
         request.body.exception != EXC_BAD_INSTRUCTION)
     {
         return false;
     }
 
     // The faulting thread is suspended so we can access cx fields that can
     // normally only be accessed by the cx's main thread.
     AutoNoteSingleThreadedRegion anstr;
 
     const CodeSegment* codeSegment = LookupCodeSegment(pc);
-    if (!codeSegment || !codeSegment->isModule())
+    if (!codeSegment || !codeSegment->isModule()) {
         return false;
+    }
 
     const ModuleSegment* moduleSegment = codeSegment->asModule();
 
     const Instance* instance = LookupFaultingInstance(*moduleSegment, pc, ContextToFP(&context));
-    if (!instance)
+    if (!instance) {
         return false;
+    }
 
     JitActivation* activation = cx->activation()->asJit();
     MOZ_ASSERT(activation->compartment() == instance->realm()->compartment());
 
     if (request.body.exception == EXC_BAD_INSTRUCTION) {
         Trap trap;
         BytecodeOffset bytecode;
-        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode))
+        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode)) {
             return false;
+        }
 
         activation->startWasmTrap(trap, bytecode.offset(), ToRegisterState(&context));
         *ppc = moduleSegment->trapCode();
     } else {
         MOZ_RELEASE_ASSERT(&instance->code() == &moduleSegment->code());
 
         MOZ_ASSERT(request.body.exception == EXC_BAD_ACCESS);
-        if (request.body.codeCnt != 2)
+        if (request.body.codeCnt != 2) {
             return false;
+        }
 
         uint8_t* faultingAddress = reinterpret_cast<uint8_t*>(request.body.code[1]);
 
         // This check isn't necessary, but, since we can, check anyway to make
         // sure we aren't covering up a real bug.
-        if (!IsHeapAccessAddress(*instance, faultingAddress))
+        if (!IsHeapAccessAddress(*instance, faultingAddress)) {
             return false;
+        }
 
-        if (!HandleOutOfBounds(&context, pc, faultingAddress, moduleSegment, *instance, activation, ppc))
+        if (!HandleOutOfBounds(&context, pc, faultingAddress, moduleSegment, *instance, activation, ppc)) {
             return false;
+        }
     }
 
     // Update the thread state with the new pc and register values.
     kret = thread_set_state(cxThread, float_state, (thread_state_t)&context.float_, float_state_count);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
     kret = thread_set_state(cxThread, thread_state, (thread_state_t)&context.thread, thread_state_count);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
 
     return true;
 }
 
 // Taken from mach_exc in /usr/include/mach/mach_exc.defs.
 static const mach_msg_id_t sExceptionId = 2405;
 
 // The choice of id here is arbitrary, the only constraint is that sQuitId != sExceptionId.
@@ -1113,18 +1134,19 @@ MachExceptionHandlerThread(JSContext* cx
         if (kret != KERN_SUCCESS) {
             fprintf(stderr, "MachExceptionHandlerThread: mach_msg failed with %d\n", (int)kret);
             MOZ_CRASH();
         }
 
         // There are only two messages we should be receiving: an exception
         // message that occurs when the runtime's thread faults and the quit
         // message sent when the runtime is shutting down.
-        if (request.body.Head.msgh_id == sQuitId)
+        if (request.body.Head.msgh_id == sQuitId) {
             break;
+        }
         if (request.body.Head.msgh_id != sExceptionId) {
             fprintf(stderr, "Unexpected msg header id %d\n", (int)request.body.Head.msgh_bits);
             MOZ_CRASH();
         }
 
         // Some thread just commited an EXC_BAD_ACCESS and has been suspended by
         // the kernel. The kernel is waiting for us to reply with instructions.
         // Our default is the "not handled" reply (by setting the RetCode field
@@ -1161,18 +1183,19 @@ MachExceptionHandler::uninstall()
     if (installed_) {
         thread_port_t thread = mach_thread_self();
         kern_return_t kret = thread_set_exception_ports(thread,
                                                         EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION,
                                                         MACH_PORT_NULL,
                                                         EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES,
                                                         THREAD_STATE_NONE);
         mach_port_deallocate(mach_task_self(), thread);
-        if (kret != KERN_SUCCESS)
+        if (kret != KERN_SUCCESS) {
             MOZ_CRASH();
+        }
         installed_ = false;
     }
     if (thread_.joinable()) {
         // Break the handler thread out of the mach_msg loop.
         mach_msg_header_t msg;
         msg.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
         msg.msgh_size = sizeof(msg);
         msg.msgh_remote_port = port_;
@@ -1204,40 +1227,44 @@ MachExceptionHandler::install(JSContext*
     mach_port_t thread;
 
     auto onFailure = mozilla::MakeScopeExit([&] {
         uninstall();
     });
 
     // Get a port which can send and receive data.
     kret = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port_);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
     kret = mach_port_insert_right(mach_task_self(), port_, port_, MACH_MSG_TYPE_MAKE_SEND);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
 
     // Create a thread to block on reading port_.
-    if (!thread_.init(MachExceptionHandlerThread, cx))
+    if (!thread_.init(MachExceptionHandlerThread, cx)) {
         return false;
+    }
 
     // Direct exceptions on this thread to port_ (and thus our handler thread).
     // Note: we are totally clobbering any existing *thread* exception ports and
     // not even attempting to forward. Breakpad and gdb both use the *process*
     // exception ports which are only called if the thread doesn't handle the
     // exception, so we should be fine.
     thread = mach_thread_self();
     kret = thread_set_exception_ports(thread,
                                       EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION,
                                       port_,
                                       EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES,
                                       THREAD_STATE_NONE);
     mach_port_deallocate(mach_task_self(), thread);
-    if (kret != KERN_SUCCESS)
+    if (kret != KERN_SUCCESS) {
         return false;
+    }
 
     installed_ = true;
     onFailure.release();
     return true;
 }
 
 #else  // If not Windows or Mac, assume Unix
 
@@ -1248,49 +1275,54 @@ MachExceptionHandler::install(JSContext*
 #endif
 
 // Be very cautious and default to not handling; we don't want to accidentally
 // silence real crashes from real bugs.
 static bool
 HandleFault(int signum, siginfo_t* info, void* ctx)
 {
     // Before anything else, prevent handler recursion.
-    if (sAlreadyInSignalHandler.get())
+    if (sAlreadyInSignalHandler.get()) {
         return false;
+    }
     AutoSignalHandler ash;
 
     MOZ_RELEASE_ASSERT(signum == SIGSEGV || signum == SIGBUS || signum == kWasmTrapSignal);
 
     CONTEXT* context = (CONTEXT*)ctx;
     uint8_t** ppc = ContextToPC(context);
     uint8_t* pc = *ppc;
 
     const CodeSegment* segment = LookupCodeSegment(pc);
-    if (!segment || !segment->isModule())
+    if (!segment || !segment->isModule()) {
         return false;
+    }
 
     const ModuleSegment* moduleSegment = segment->asModule();
 
     const Instance* instance = LookupFaultingInstance(*moduleSegment, pc, ContextToFP(context));
-    if (!instance)
+    if (!instance) {
         return false;
+    }
 
     JitActivation* activation = TlsContext.get()->activation()->asJit();
     MOZ_ASSERT(activation->compartment() == instance->realm()->compartment());
 
     if (signum == kWasmTrapSignal) {
         // Wasm traps for MIPS raise only integer overflow fp exception.
 #ifdef __mips__
-        if (info->si_code != FPE_INTOVF)
+        if (info->si_code != FPE_INTOVF) {
             return false;
+        }
 #endif
         Trap trap;
         BytecodeOffset bytecode;
-        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode))
+        if (!moduleSegment->code().lookupTrap(pc, &trap, &bytecode)) {
             return false;
+        }
 
         activation->startWasmTrap(trap, bytecode.offset(), ToRegisterState(context));
         *ppc = moduleSegment->trapCode();
         return true;
     }
 
     MOZ_RELEASE_ASSERT(&instance->code() == &moduleSegment->code());
 
@@ -1300,38 +1332,41 @@ HandleFault(int signum, siginfo_t* info,
     // any real bugs, check that the faulting address is indeed in the
     // instance's memory.
     if (!faultingAddress) {
         // On some Linux systems, the kernel apparently sometimes "gives up" and
         // passes a null faultingAddress with si_code set to SI_KERNEL.
         // This is observed on some automation machines for some out-of-bounds
         // atomic accesses on x86/64.
 #ifdef SI_KERNEL
-        if (info->si_code != SI_KERNEL)
+        if (info->si_code != SI_KERNEL) {
             return false;
+        }
 #else
         return false;
 #endif
     } else {
-        if (!IsHeapAccessAddress(*instance, faultingAddress))
+        if (!IsHeapAccessAddress(*instance, faultingAddress)) {
             return false;
+        }
     }
 
     return HandleOutOfBounds(context, pc, faultingAddress, moduleSegment, *instance, activation, ppc);
 }
 
 static struct sigaction sPrevSEGVHandler;
 static struct sigaction sPrevSIGBUSHandler;
 static struct sigaction sPrevWasmTrapHandler;
 
 static void
 WasmFaultHandler(int signum, siginfo_t* info, void* context)
 {
-    if (HandleFault(signum, info, context))
+    if (HandleFault(signum, info, context)) {
         return;
+    }
 
     struct sigaction* previousSignal = nullptr;
     switch (signum) {
       case SIGSEGV: previousSignal = &sPrevSEGVHandler; break;
       case SIGBUS: previousSignal = &sPrevSIGBUSHandler; break;
       case kWasmTrapSignal: previousSignal = &sPrevWasmTrapHandler; break;
     }
     MOZ_ASSERT(previousSignal);
@@ -1343,53 +1378,57 @@ WasmFaultHandler(int signum, siginfo_t* 
     // be re-executed which will crash in the normal way. The advantage of
     // doing this to calling _exit() is that we remove ourselves from the crash
     // stack which improves crash reports. If there is a next handler, call it.
     // It will either crash synchronously, fix up the instruction so that
     // execution can continue and return, or trigger a crash by returning the
     // signal to it's original disposition and returning.
     //
     // Note: the order of these tests matter.
-    if (previousSignal->sa_flags & SA_SIGINFO)
+    if (previousSignal->sa_flags & SA_SIGINFO) {
         previousSignal->sa_sigaction(signum, info, context);
-    else if (previousSignal->sa_handler == SIG_DFL || previousSignal->sa_handler == SIG_IGN)
+    } else if (previousSignal->sa_handler == SIG_DFL || previousSignal->sa_handler == SIG_IGN) {
         sigaction(signum, previousSignal, nullptr);
-    else
+    } else {
         previousSignal->sa_handler(signum);
+    }
 }
 # endif // XP_WIN || XP_DARWIN || assume unix
 
 #if defined(ANDROID) && defined(MOZ_LINKER)
 extern "C" MFBT_API bool IsSignalHandlingBroken();
 #endif
 
 static bool sTriedInstallSignalHandlers = false;
 static bool sHaveSignalHandlers = false;
 
 static bool
 ProcessHasSignalHandlers()
 {
     // We assume that there are no races creating the first JSRuntime of the process.
-    if (sTriedInstallSignalHandlers)
+    if (sTriedInstallSignalHandlers) {
         return sHaveSignalHandlers;
+    }
     sTriedInstallSignalHandlers = true;
 
 #if defined (JS_CODEGEN_NONE)
     // If there is no JIT, then there should be no Wasm signal handlers.
     return false;
 #endif
 
     // Signal handlers are currently disabled when recording or replaying.
-    if (mozilla::recordreplay::IsRecordingOrReplaying())
+    if (mozilla::recordreplay::IsRecordingOrReplaying()) {
         return false;
+    }
 
 #if defined(ANDROID) && defined(MOZ_LINKER)
     // Signal handling is broken on some android systems.
-    if (IsSignalHandlingBroken())
+    if (IsSignalHandlingBroken()) {
         return false;
+    }
 #endif
 
     // Initalize ThreadLocal flag used by WasmFaultHandler
     sAlreadyInSignalHandler.infallibleInit();
 
     // Install a SIGSEGV handler to handle safely-out-of-bounds asm.js heap
     // access and/or unaligned accesses.
 #if defined(XP_WIN)
@@ -1399,69 +1438,75 @@ ProcessHasSignalHandlers()
     // MemoryProtectionExceptionHandler::isDisabled().
     const bool firstHandler = false;
 # else
     // Otherwise, WasmFaultHandler needs to go first, so that we can recover
     // from wasm faults and continue execution without triggering handlers
     // such as MemoryProtectionExceptionHandler that assume we are crashing.
     const bool firstHandler = true;
 # endif
-    if (!AddVectoredExceptionHandler(firstHandler, WasmFaultHandler))
+    if (!AddVectoredExceptionHandler(firstHandler, WasmFaultHandler)) {
         return false;
+    }
 #elif defined(XP_DARWIN)
     // OSX handles seg faults via the Mach exception handler above, so don't
     // install WasmFaultHandler.
 #else
     // SA_NODEFER allows us to reenter the signal handler if we crash while
     // handling the signal, and fall through to the Breakpad handler by testing
     // handlingSegFault.
 
     // Allow handling OOB with signals on all architectures
     struct sigaction faultHandler;
     faultHandler.sa_flags = SA_SIGINFO | SA_NODEFER | SA_ONSTACK;
     faultHandler.sa_sigaction = WasmFaultHandler;
     sigemptyset(&faultHandler.sa_mask);
-    if (sigaction(SIGSEGV, &faultHandler, &sPrevSEGVHandler))
+    if (sigaction(SIGSEGV, &faultHandler, &sPrevSEGVHandler)) {
         MOZ_CRASH("unable to install segv handler");
+    }
 
 # if defined(JS_CODEGEN_ARM)
     // On Arm Handle Unaligned Accesses
     struct sigaction busHandler;
     busHandler.sa_flags = SA_SIGINFO | SA_NODEFER | SA_ONSTACK;
     busHandler.sa_sigaction = WasmFaultHandler;
     sigemptyset(&busHandler.sa_mask);
-    if (sigaction(SIGBUS, &busHandler, &sPrevSIGBUSHandler))
+    if (sigaction(SIGBUS, &busHandler, &sPrevSIGBUSHandler)) {
         MOZ_CRASH("unable to install sigbus handler");
+    }
 # endif
 
     // Install a handler to handle the instructions that are emitted to implement
     // wasm traps.
     struct sigaction wasmTrapHandler;
     wasmTrapHandler.sa_flags = SA_SIGINFO | SA_NODEFER | SA_ONSTACK;
     wasmTrapHandler.sa_sigaction = WasmFaultHandler;
     sigemptyset(&wasmTrapHandler.sa_mask);
-    if (sigaction(kWasmTrapSignal, &wasmTrapHandler, &sPrevWasmTrapHandler))
+    if (sigaction(kWasmTrapSignal, &wasmTrapHandler, &sPrevWasmTrapHandler)) {
         MOZ_CRASH("unable to install wasm trap handler");
+    }
 #endif
 
     sHaveSignalHandlers = true;
     return true;
 }
 
 bool
 wasm::EnsureSignalHandlers(JSContext* cx)
 {
     // Nothing to do if the platform doesn't support it.
-    if (!ProcessHasSignalHandlers())
+    if (!ProcessHasSignalHandlers()) {
         return true;
+    }
 
 #if defined(XP_DARWIN)
     // On OSX, each JSContext which runs wasm gets its own handler thread.
-    if (!cx->wasmMachExceptionHandler.installed() && !cx->wasmMachExceptionHandler.install(cx))
+    if (!cx->wasmMachExceptionHandler.installed() && !cx->wasmMachExceptionHandler.install(cx)) {
         return false;
+    }
 #endif
 
     return true;
 }
 
 bool
 wasm::HaveSignalHandlers()
 {
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -54,47 +54,50 @@ AssertStackAlignment(MacroAssembler& mas
     masm.assertStackAlignment(alignment, addBeforeAssert);
 }
 
 template <class VectorT>
 static unsigned
 StackArgBytes(const VectorT& args)
 {
     ABIArgIter<VectorT> iter(args);
-    while (!iter.done())
+    while (!iter.done()) {
         iter++;
+    }
     return iter.stackBytesConsumedSoFar();
 }
 
 static void
 SetupABIArguments(MacroAssembler& masm, const FuncExport& fe, Register argv, Register scratch)
 {
     // Copy parameters out of argv and into the registers/stack-slots specified by
     // the system ABI.
     for (ABIArgValTypeIter iter(fe.funcType().args()); !iter.done(); iter++) {
         unsigned argOffset = iter.index() * sizeof(ExportArg);
         Address src(argv, argOffset);
         MIRType type = iter.mirType();
         switch (iter->kind()) {
           case ABIArg::GPR:
-            if (type == MIRType::Int32)
+            if (type == MIRType::Int32) {
                 masm.load32(src, iter->gpr());
-            else if (type == MIRType::Int64)
+            } else if (type == MIRType::Int64) {
                 masm.load64(src, iter->gpr64());
-            else if (type == MIRType::Pointer)
+            } else if (type == MIRType::Pointer) {
                 masm.loadPtr(src, iter->gpr());
-            else
+            } else {
                 MOZ_CRASH("unknown GPR type");
+            }
             break;
 #ifdef JS_CODEGEN_REGISTER_PAIR
           case ABIArg::GPR_PAIR:
-            if (type == MIRType::Int64)
+            if (type == MIRType::Int64) {
                 masm.load64(src, iter->gpr64());
-            else
+            } else {
                 MOZ_CRASH("wasm uses hardfp for function calls.");
+            }
             break;
 #endif
           case ABIArg::FPU: {
             static_assert(sizeof(ExportArg) >= jit::Simd128DataSize,
                           "ExportArg must be big enough to store SIMD values");
             switch (type) {
               case MIRType::Double:
                 masm.loadDouble(src, iter->fpu());
@@ -280,20 +283,21 @@ SuppressGC(MacroAssembler& masm, int32_t
                                 js::ThreadData<int32_t>::offsetOfValue()));
 }
 #endif
 
 static void
 CallFuncExport(MacroAssembler& masm, const FuncExport& fe, const Maybe<ImmPtr>& funcPtr)
 {
     MOZ_ASSERT(fe.hasEagerStubs() == !funcPtr);
-    if (funcPtr)
+    if (funcPtr) {
         masm.call(*funcPtr);
-    else
+    } else {
         masm.call(CallSiteDesc(CallSiteDesc::Func), fe.funcIndex());
+    }
 }
 
 // Generate a stub that enters wasm from a C++ caller via the native ABI. The
 // signature of the entry point is Module::ExportFuncPtr. The exported wasm
 // function has an ABI derived from its specific signature, so this function
 // must map from the ABI of ExportFuncPtr to the export's signature's ABI.
 static bool
 GenerateInterpEntry(MacroAssembler& masm, const FuncExport& fe, const Maybe<ImmPtr>& funcPtr,
@@ -333,32 +337,35 @@ GenerateInterpEntry(MacroAssembler& masm
     // Read the arguments of wasm::ExportFuncPtr according to the native ABI.
     // The entry stub's frame is 1 word.
     const unsigned argBase = sizeof(void*) + masm.framePushed();
     ABIArgGenerator abi;
     ABIArg arg;
 
     // arg 1: ExportArg*
     arg = abi.next(MIRType::Pointer);
-    if (arg.kind() == ABIArg::GPR)
+    if (arg.kind() == ABIArg::GPR) {
         masm.movePtr(arg.gpr(), argv);
-    else
+    } else {
         masm.loadPtr(Address(masm.getStackPointer(), argBase + arg.offsetFromArgBase()), argv);
+    }
 
     // Arg 2: TlsData*
     arg = abi.next(MIRType::Pointer);
-    if (arg.kind() == ABIArg::GPR)
+    if (arg.kind() == ABIArg::GPR) {
         masm.movePtr(arg.gpr(), WasmTlsReg);
-    else
+    } else {
         masm.loadPtr(Address(masm.getStackPointer(), argBase + arg.offsetFromArgBase()), WasmTlsReg);
+    }
 
 #ifdef ENABLE_WASM_GC
     WasmPush(masm, WasmTlsReg);
-    if (gcTypesConfigured == HasGcTypes::True)
+    if (gcTypesConfigured == HasGcTypes::True) {
         SuppressGC(masm, 1, scratch);
+    }
 #endif
 
     // Save 'argv' on the stack so that we can recover it after the call.
     WasmPush(masm, argv);
 
     // Since we're about to dynamically align the stack, reset the frame depth
     // so we can still assert static stack depth balancing.
     MOZ_ASSERT(masm.framePushed() == FramePushedBeforeAlign);
@@ -406,18 +413,19 @@ GenerateInterpEntry(MacroAssembler& masm
     MOZ_ASSERT(masm.framePushed() == 0);
     masm.setFramePushed(FramePushedBeforeAlign);
 
     // Recover the 'argv' pointer which was saved before aligning the stack.
     WasmPop(masm, argv);
 
 #ifdef ENABLE_WASM_GC
     WasmPop(masm, WasmTlsReg);
-    if (gcTypesConfigured == HasGcTypes::True)
+    if (gcTypesConfigured == HasGcTypes::True) {
         SuppressGC(masm, -1, WasmTlsReg);
+    }
 #endif
 
     // Store the return value in argv[0].
     StoreABIReturn(masm, fe, argv);
 
     // After the ReturnReg is stored into argv[0] but before fp is clobbered by
     // the PopRegsInMask(NonVolatileRegs) below, set the return value based on
     // whether fp is null (which is the case for successful returns) or the
@@ -456,20 +464,21 @@ static const ValueOperand ScratchValIonE
 #else
 static const ValueOperand ScratchValIonEntry = ValueOperand(ABINonArgReg0, ABINonArgReg1);
 #endif
 static const Register ScratchIonEntry = ABINonArgReg2;
 
 static void
 CallSymbolicAddress(MacroAssembler& masm, bool isAbsolute, SymbolicAddress sym)
 {
-    if (isAbsolute)
+    if (isAbsolute) {
         masm.call(ImmPtr(SymbolicAddressTarget(sym), ImmPtr::NoCheckToken()));
-    else
+    } else {
         masm.call(sym);
+    }
 }
 
 // Load instance's TLS from the callee.
 static void
 GenerateJitEntryLoadTls(MacroAssembler& masm, unsigned frameSize)
 {
     AssertExpectedSP(masm);
 
@@ -698,33 +707,36 @@ GenerateJitEntry(MacroAssembler& masm, s
     for (ABIArgValTypeIter iter(fe.funcType().args()); !iter.done(); iter++) {
         unsigned jitArgOffset = frameSize + JitFrameLayout::offsetOfActualArg(iter.index());
         Address argv(sp, jitArgOffset);
         bool isStackArg = iter->kind() == ABIArg::Stack;
         switch (iter.mirType()) {
           case MIRType::Int32: {
             Register target = isStackArg ? ScratchIonEntry : iter->gpr();
             masm.unboxInt32(argv, target);
-            if (isStackArg)
+            if (isStackArg) {
                 masm.storePtr(target, Address(sp, iter->offsetFromArgBase()));
+            }
             break;
           }
           case MIRType::Float32: {
             FloatRegister target = isStackArg ? ABINonArgDoubleReg : iter->fpu();
             masm.unboxDouble(argv, ABINonArgDoubleReg);
             masm.convertDoubleToFloat32(ABINonArgDoubleReg, target);
-            if (isStackArg)
+            if (isStackArg) {
                 masm.storeFloat32(target, Address(sp, iter->offsetFromArgBase()));
+            }
             break;
           }
           case MIRType::Double: {
             FloatRegister target = isStackArg ? ABINonArgDoubleReg : iter->fpu();
             masm.unboxDouble(argv, target);
-            if (isStackArg)
+            if (isStackArg) {
                 masm.storeDouble(target, Address(sp, iter->offsetFromArgBase()));
+            }
             break;
           }
           default: {
             MOZ_CRASH("unexpected input argument when calling from jit");
           }
         }
     }
 
@@ -802,27 +814,29 @@ GenerateJitEntry(MacroAssembler& masm, s
     // Generate an OOL call to the C++ conversion path.
     if (fe.funcType().args().length()) {
         masm.bind(&oolCall);
         masm.setFramePushed(frameSize);
 
         ABIArgMIRTypeIter argsIter(coerceArgTypes);
 
         // argument 0: function export index.
-        if (argsIter->kind() == ABIArg::GPR)
+        if (argsIter->kind() == ABIArg::GPR) {
             masm.movePtr(ImmWord(funcExportIndex), argsIter->gpr());
-        else
+        } else {
             masm.storePtr(ImmWord(funcExportIndex), Address(sp, argsIter->offsetFromArgBase()));
+        }
         argsIter++;
 
         // argument 1: tlsData
-        if (argsIter->kind() == ABIArg::GPR)
+        if (argsIter->kind() == ABIArg::GPR) {
             masm.movePtr(WasmTlsReg, argsIter->gpr());
-        else
+        } else {
             masm.storePtr(WasmTlsReg, Address(sp, argsIter->offsetFromArgBase()));
+        }
         argsIter++;
 
         // argument 2: effective address of start of argv
         Address argv(sp, masm.framePushed() + JitFrameLayout::offsetOfActualArg(0));
         if (argsIter->kind() == ABIArg::GPR) {
             masm.computeEffectiveAddress(argv, argsIter->gpr());
         } else {
             masm.computeEffectiveAddress(argv, ScratchIonEntry);
@@ -882,24 +896,26 @@ wasm::GenerateDirectCallFromJit(MacroAss
 
     masm.moveStackPtrTo(FramePointer);
     masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::DirectWasmJitCall);
     masm.orPtr(Imm32(ExitOrJitEntryFPTag), FramePointer);
 
     // Move stack arguments to their final locations.
     unsigned bytesNeeded = StackArgBytes(fe.funcType().args());
     bytesNeeded = StackDecrementForCall(WasmStackAlignment, masm.framePushed(), bytesNeeded);
-    if (bytesNeeded)
+    if (bytesNeeded) {
         masm.reserveStack(bytesNeeded);
+    }
 
     for (ABIArgValTypeIter iter(fe.funcType().args()); !iter.done(); iter++) {
         MOZ_ASSERT_IF(iter->kind() == ABIArg::GPR, iter->gpr() != scratch);
         MOZ_ASSERT_IF(iter->kind() == ABIArg::GPR, iter->gpr() != FramePointer);
-        if (iter->kind() != ABIArg::Stack)
+        if (iter->kind() != ABIArg::Stack) {
             continue;
+        }
 
         Address dst(masm.getStackPointer(), iter->offsetFromArgBase());
 
         const JitCallStackArg& stackArg = stackArgs[iter.index()];
         switch (stackArg.tag()) {
           case JitCallStackArg::Tag::Imm32:
             masm.storePtr(ImmWord(stackArg.imm32()), dst);
             break;
@@ -948,32 +964,34 @@ wasm::GenerateDirectCallFromJit(MacroAss
         }
     }
 
     // Load tls; from now on, WasmTlsReg is live.
     masm.movePtr(ImmPtr(inst.tlsData()), WasmTlsReg);
     masm.loadWasmPinnedRegsFromTls();
 
 #ifdef ENABLE_WASM_GC
-    if (wasmGcEnabled)
+    if (wasmGcEnabled) {
         SuppressGC(masm, 1, ABINonArgReg0);
+    }
 #endif
 
     // Actual call.
     const wasm::CodeTier& codeTier = inst.code().codeTier(inst.code().bestTier());
     uint32_t offset = codeTier.metadata().codeRanges[fe.funcCodeRangeIndex()].funcNormalEntry();
     void* callee = codeTier.segment().base() + offset;
 
     masm.assertStackAlignment(WasmStackAlignment);
     masm.callJit(ImmPtr(callee));
     masm.assertStackAlignment(WasmStackAlignment);
 
 #ifdef ENABLE_WASM_GC
-    if (wasmGcEnabled)
+    if (wasmGcEnabled) {
         SuppressGC(masm, -1, WasmTlsReg);
+    }
 #endif
 
     masm.branchPtr(Assembler::Equal, FramePointer, Imm32(wasm::FailFP), masm.exceptionLabel());
 
     // Store the return value in the appropriate place.
     switch (fe.funcType().ret().code()) {
       case wasm::ExprType::Void:
         masm.moveValue(UndefinedValue(), JSReturnOperand);
@@ -993,18 +1011,19 @@ wasm::GenerateDirectCallFromJit(MacroAss
       case wasm::ExprType::Limit:
         MOZ_CRASH("Limit");
     }
 
     // Free args + frame descriptor.
     masm.leaveExitFrame(bytesNeeded + ExitFrameLayout::Size());
 
     // If we pushed it, free FramePointer.
-    if (profilingEnabled)
+    if (profilingEnabled) {
         masm.Pop(FramePointer);
+    }
 
     MOZ_ASSERT(framePushedAtStart == masm.framePushed());
 }
 
 static void
 StackCopy(MacroAssembler& masm, MIRType type, Register scratch, Address src, Address dst)
 {
     if (type == MIRType::Int32) {
@@ -1042,38 +1061,42 @@ FillArgumentArray(MacroAssembler& masm, 
 {
     for (ABIArgValTypeIter i(args); !i.done(); i++) {
         Address dst(masm.getStackPointer(), argOffset + i.index() * sizeof(Value));
 
         MIRType type = i.mirType();
         switch (i->kind()) {
           case ABIArg::GPR:
             if (type == MIRType::Int32) {
-                if (toValue)
+                if (toValue) {
                     masm.storeValue(JSVAL_TYPE_INT32, i->gpr(), dst);
-                else
+                } else {
                     masm.store32(i->gpr(), dst);
+                }
             } else if (type == MIRType::Int64) {
                 // We can't box int64 into Values (yet).
-                if (toValue)
+                if (toValue) {
                     masm.breakpoint();
-                else
+                } else {
                     masm.store64(i->gpr64(), dst);
+                }
             } else if (type == MIRType::Pointer) {
-                if (toValue)
+                if (toValue) {
                     MOZ_CRASH("generating a jit exit for anyref NYI");
+                }
                 masm.storePtr(i->gpr(), dst);
             }
             break;
 #ifdef JS_CODEGEN_REGISTER_PAIR
           case ABIArg::GPR_PAIR:
-            if (type == MIRType::Int64)
+            if (type == MIRType::Int64) {
                 masm.store64(i->gpr64(), dst);
-            else
+            } else {
                 MOZ_CRASH("wasm uses hardfp for function calls.");
+            }
             break;
 #endif
           case ABIArg::FPU: {
             MOZ_ASSERT(IsFloatingPointType(type));
             FloatRegister srcReg = i->fpu();
             if (type == MIRType::Double) {
                 if (toValue) {
                     // Preserve the NaN pattern in the input.
@@ -1156,18 +1179,19 @@ GenerateImportFunction(jit::MacroAssembl
     // The argument register state is already setup by our caller. We just need
     // to be sure not to clobber it before the call.
     Register scratch = ABINonArgReg0;
 
     // Copy our frame's stack arguments to the callee frame's stack argument.
     unsigned offsetToCallerStackArgs = sizeof(Frame) + masm.framePushed();
     ABIArgValTypeIter i(fi.funcType().args());
     for (; !i.done(); i++) {
-        if (i->kind() != ABIArg::Stack)
+        if (i->kind() != ABIArg::Stack) {
             continue;
+        }
 
         Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
         Address dst(masm.getStackPointer(), i->offsetFromArgBase());
         StackCopy(masm, i.mirType(), scratch, src, dst);
     }
 
     // Call the import exit stub.
     CallSiteDesc desc(CallSiteDesc::Dynamic);
@@ -1194,25 +1218,28 @@ wasm::GenerateImportFunctions(const Modu
     LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
     TempAllocator alloc(&lifo);
     WasmMacroAssembler masm(alloc);
 
     for (uint32_t funcIndex = 0; funcIndex < imports.length(); funcIndex++) {
         const FuncImport& fi = imports[funcIndex];
 
         FuncOffsets offsets;
-        if (!GenerateImportFunction(masm, fi, env.funcTypes[funcIndex]->id, &offsets))
+        if (!GenerateImportFunction(masm, fi, env.funcTypes[funcIndex]->id, &offsets)) {
             return false;
-        if (!code->codeRanges.emplaceBack(funcIndex, /* bytecodeOffset = */ 0, offsets))
+        }
+        if (!code->codeRanges.emplaceBack(funcIndex, /* bytecodeOffset = */ 0, offsets)) {
             return false;
+        }
     }
 
     masm.finish();
-    if (masm.oom())
+    if (masm.oom()) {
         return false;
+    }
 
     return code->swap(masm);
 }
 
 // Generate a stub that is called via the internal ABI derived from the
 // signature of the import and calls into an appropriate callImport C++
 // function, having boxed all the ABI arguments into a homogeneous Value array.
 static bool
@@ -1256,28 +1283,30 @@ GenerateImportInterpExit(MacroAssembler&
         masm.loadPtr(instancePtr, i->gpr());
     } else {
         masm.loadPtr(instancePtr, scratch);
         masm.storePtr(scratch, Address(masm.getStackPointer(), i->offsetFromArgBase()));
     }
     i++;
 
     // argument 1: funcImportIndex
-    if (i->kind() == ABIArg::GPR)
+    if (i->kind() == ABIArg::GPR) {
         masm.mov(ImmWord(funcImportIndex), i->gpr());
-    else
+    } else {
         masm.store32(Imm32(funcImportIndex), Address(masm.getStackPointer(), i->offsetFromArgBase()));
+    }
     i++;
 
     // argument 2: argc
     unsigned argc = fi.funcType().args().length();
-    if (i->kind() == ABIArg::GPR)
+    if (i->kind() == ABIArg::GPR) {
         masm.mov(ImmWord(argc), i->gpr());
-    else
+    } else {
         masm.store32(Imm32(argc), Address(masm.getStackPointer(), i->offsetFromArgBase()));
+    }
     i++;
 
     // argument 3: argv
     Address argv(masm.getStackPointer(), argOffset);
     if (i->kind() == ABIArg::GPR) {
         masm.computeEffectiveAddress(argv, i->gpr());
     } else {
         masm.computeEffectiveAddress(argv, scratch);
@@ -1553,18 +1582,19 @@ GenerateImportJitExit(MacroAssembler& ma
             masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
             masm.unboxInt32(Address(masm.getStackPointer(), offsetToCoerceArgv), ReturnReg);
             break;
           case ExprType::F64:
           case ExprType::F32:
             masm.call(SymbolicAddress::CoerceInPlace_ToNumber);
             masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
             masm.loadDouble(Address(masm.getStackPointer(), offsetToCoerceArgv), ReturnDoubleReg);
-            if (fi.funcType().ret() == ExprType::F32)
+            if (fi.funcType().ret() == ExprType::F32) {
                 masm.convertDoubleToFloat32(ReturnDoubleReg, ReturnFloat32Reg);
+            }
             break;
           default:
             MOZ_CRASH("Unsupported convert type");
         }
 
         // Maintain the invariant that exitFP is either unset or not set to a
         // wasm tagged exitFP, per the jit exit contract.
         ClearExitFP(masm, scratch);
@@ -1594,18 +1624,19 @@ struct ABIFunctionArgs
         }
     }
 
     size_t length() const { return len; }
 
     MIRType operator[](size_t i) const {
         MOZ_ASSERT(i < len);
         uint32_t abi = uint32_t(abiType);
-        while (i--)
+        while (i--) {
             abi = abi >> ArgType_Shift;
+        }
         return ToMIRType(ABIArgType(abi & ArgType_Mask));
     }
 };
 
 bool
 wasm::GenerateBuiltinThunk(MacroAssembler& masm, ABIFunctionType abiType, ExitReason exitReason,
                            void* funcPtr, CallableOffsets* offsets)
 {
@@ -1657,18 +1688,19 @@ wasm::GenerateBuiltinThunk(MacroAssemble
         masm.loadFloat32(op, ReturnFloat32Reg);
     } else if (retType == MIRType::Double) {
         masm.fstp(op);
         masm.loadDouble(op, ReturnDoubleReg);
     }
 #elif defined(JS_CODEGEN_ARM)
     // Non hard-fp passes the return values in GPRs.
     MIRType retType = ToMIRType(ABIArgType(abiType & ArgType_Mask));
-    if (!UseHardFpABI() && IsFloatingPointType(retType))
+    if (!UseHardFpABI() && IsFloatingPointType(retType)) {
         masm.ma_vxfer(r0, r1, d0);
+    }
 #endif
 
     GenerateExitEpilogue(masm, framePushed, exitReason, offsets);
     return FinishOffsets(masm, offsets);
 }
 
 #if defined(JS_CODEGEN_ARM)
 static const LiveRegisterSet RegsToPreserve(
@@ -1722,18 +1754,19 @@ GenerateTrapExit(MacroAssembler& masm, L
     masm.PushRegsInMask(RegsToPreserve);
     unsigned offsetOfReturnWord = masm.framePushed() - framePushedBeforePreserve;
 
     // We know that StackPointer is word-aligned, but not necessarily
     // stack-aligned, so we need to align it dynamically.
     Register preAlignStackPointer = ABINonVolatileReg;
     masm.moveStackPtrTo(preAlignStackPointer);
     masm.andToStackPtr(Imm32(~(ABIStackAlignment - 1)));
-    if (ShadowStackSpace)
+    if (ShadowStackSpace) {
         masm.subFromStackPtr(Imm32(ShadowStackSpace));
+    }
 
     masm.assertStackAlignment(ABIStackAlignment);
     masm.call(SymbolicAddress::HandleTrap);
 
     // WasmHandleTrap returns null if control should transfer to the throw stub.
     masm.branchTestPtr(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
 
     // Otherwise, the return value is the TrapData::resumePC we must jump to.
@@ -1765,18 +1798,19 @@ GenerateThrowStub(MacroAssembler& masm, 
 
     masm.bind(throwLabel);
 
     offsets->begin = masm.currentOffset();
 
     // Conservatively, the stack pointer can be unaligned and we must align it
     // dynamically.
     masm.andToStackPtr(Imm32(~(ABIStackAlignment - 1)));
-    if (ShadowStackSpace)
+    if (ShadowStackSpace) {
         masm.subFromStackPtr(Imm32(ShadowStackSpace));
+    }
 
     // WasmHandleThrow unwinds JitActivation::wasmExitFP() and returns the
     // address of the return address on the stack this stub should return to.
     // Set the FramePointer to a magic value to indicate a return by throw.
     masm.call(SymbolicAddress::HandleThrow);
     masm.moveToStackPtr(ReturnReg);
     masm.move32(Imm32(FailFP), FramePointer);
 #ifdef JS_CODEGEN_ARM64
@@ -1819,25 +1853,27 @@ GenerateDebugTrapStub(MacroAssembler& ma
 #else
     Register scratch = ABINonArgReturnReg0;
     masm.moveStackPtrTo(scratch);
     masm.subFromStackPtr(Imm32(sizeof(intptr_t)));
     masm.andToStackPtr(Imm32(~(ABIStackAlignment - 1)));
     masm.storePtr(scratch, Address(masm.getStackPointer(), 0));
 #endif
 
-    if (ShadowStackSpace)
+    if (ShadowStackSpace) {
         masm.subFromStackPtr(Imm32(ShadowStackSpace));
+    }
     masm.assertStackAlignment(ABIStackAlignment);
     masm.call(SymbolicAddress::HandleDebugTrap);
 
     masm.branchIfFalseBool(ReturnReg, throwLabel);
 
-    if (ShadowStackSpace)
+    if (ShadowStackSpace) {
         masm.addToStackPtr(Imm32(ShadowStackSpace));
+    }
 #ifndef JS_CODEGEN_ARM64
     masm.Pop(scratch);
     masm.moveToStackPtr(scratch);
 #endif
 
     masm.setFramePushed(framePushed);
     masm.PopRegsInMask(AllAllocatableRegs);
 
@@ -1850,99 +1886,118 @@ bool
 wasm::GenerateEntryStubs(MacroAssembler& masm, size_t funcExportIndex, const FuncExport& fe,
                          const Maybe<ImmPtr>& callee, bool isAsmJS, HasGcTypes gcTypesConfigured,
                          CodeRangeVector* codeRanges)
 {
     MOZ_ASSERT(!callee == fe.hasEagerStubs());
     MOZ_ASSERT_IF(isAsmJS, fe.hasEagerStubs());
 
     Offsets offsets;
-    if (!GenerateInterpEntry(masm, fe, callee, gcTypesConfigured, &offsets))
+    if (!GenerateInterpEntry(masm, fe, callee, gcTypesConfigured, &offsets)) {
         return false;
-    if (!codeRanges->emplaceBack(CodeRange::InterpEntry, fe.funcIndex(), offsets))
+    }
+    if (!codeRanges->emplaceBack(CodeRange::InterpEntry, fe.funcIndex(), offsets)) {
         return false;
+    }
 
-    if (isAsmJS || fe.funcType().temporarilyUnsupportedAnyRef())
+    if (isAsmJS || fe.funcType().temporarilyUnsupportedAnyRef()) {
         return true;
+    }
 
-    if (!GenerateJitEntry(masm, funcExportIndex, fe, callee, gcTypesConfigured, &offsets))
+    if (!GenerateJitEntry(masm, funcExportIndex, fe, callee, gcTypesConfigured, &offsets)) {
         return false;
-    if (!codeRanges->emplaceBack(CodeRange::JitEntry, fe.funcIndex(), offsets))
+    }
+    if (!codeRanges->emplaceBack(CodeRange::JitEntry, fe.funcIndex(), offsets)) {
         return false;
+    }
 
     return true;
 }
 
 bool
 wasm::GenerateStubs(const ModuleEnvironment& env, const FuncImportVector& imports,
                     const FuncExportVector& exports, CompiledCode* code)
 {
     LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
     TempAllocator alloc(&lifo);
     WasmMacroAssembler masm(alloc);
 
     // Swap in already-allocated empty vectors to avoid malloc/free.
-    if (!code->swap(masm))
+    if (!code->swap(masm)) {
         return false;
+    }
 
     Label throwLabel;
 
     JitSpew(JitSpew_Codegen, "# Emitting wasm import stubs");
 
     for (uint32_t funcIndex = 0; funcIndex < imports.length(); funcIndex++) {
         const FuncImport& fi = imports[funcIndex];
 
         CallableOffsets interpOffsets;
-        if (!GenerateImportInterpExit(masm, fi, funcIndex, &throwLabel, &interpOffsets))
+        if (!GenerateImportInterpExit(masm, fi, funcIndex, &throwLabel, &interpOffsets)) {
             return false;
-        if (!code->codeRanges.emplaceBack(CodeRange::ImportInterpExit, funcIndex, interpOffsets))
+        }
+        if (!code->codeRanges.emplaceBack(CodeRange::ImportInterpExit, funcIndex, interpOffsets)) {
             return false;
+        }
 
-        if (fi.funcType().temporarilyUnsupportedAnyRef())
+        if (fi.funcType().temporarilyUnsupportedAnyRef()) {
             continue;
+        }
 
         JitExitOffsets jitOffsets;
-        if (!GenerateImportJitExit(masm, fi, &throwLabel, &jitOffsets))
+        if (!GenerateImportJitExit(masm, fi, &throwLabel, &jitOffsets)) {
             return false;
-        if (!code->codeRanges.emplaceBack(funcIndex, jitOffsets))
+        }
+        if (!code->codeRanges.emplaceBack(funcIndex, jitOffsets)) {
             return false;
+        }
     }
 
     JitSpew(JitSpew_Codegen, "# Emitting wasm export stubs");
 
     Maybe<ImmPtr> noAbsolute;
     for (size_t i = 0; i < exports.length(); i++) {
         const FuncExport& fe = exports[i];
-        if (!fe.hasEagerStubs())
+        if (!fe.hasEagerStubs()) {
             continue;
+        }
         if (!GenerateEntryStubs(masm, i, fe, noAbsolute, env.isAsmJS(),
                                 env.gcTypesConfigured, &code->codeRanges))
         {
             return false;
         }
     }
 
     JitSpew(JitSpew_Codegen, "# Emitting wasm exit stubs");
 
     Offsets offsets;
 
-    if (!GenerateTrapExit(masm, &throwLabel, &offsets))
+    if (!GenerateTrapExit(masm, &throwLabel, &offsets)) {
         return false;
-    if (!code->codeRanges.emplaceBack(CodeRange::TrapExit, offsets))
+    }
+    if (!code->codeRanges.emplaceBack(CodeRange::TrapExit, offsets)) {
         return false;
+    }
 
     CallableOffsets callableOffsets;
-    if (!GenerateDebugTrapStub(masm, &throwLabel, &callableOffsets))
+    if (!GenerateDebugTrapStub(masm, &throwLabel, &callableOffsets)) {
         return false;
-    if (!code->codeRanges.emplaceBack(CodeRange::DebugTrap, callableOffsets))
+    }
+    if (!code->codeRanges.emplaceBack(CodeRange::DebugTrap, callableOffsets)) {
         return false;
+    }
 
-    if (!GenerateThrowStub(masm, &throwLabel, &offsets))
+    if (!GenerateThrowStub(masm, &throwLabel, &offsets)) {
         return false;
-    if (!code->codeRanges.emplaceBack(CodeRange::Throw, offsets))
+    }
+    if (!code->codeRanges.emplaceBack(CodeRange::Throw, offsets)) {
         return false;
+    }
 
     masm.finish();
-    if (masm.oom())
+    if (masm.oom()) {
         return false;
+    }
 
     return code->swap(masm);
 }
--- a/js/src/wasm/WasmTable.cpp
+++ b/js/src/wasm/WasmTable.cpp
@@ -42,22 +42,24 @@ Table::Table(JSContext* cx, const TableD
 
 /* static */ SharedTable
 Table::create(JSContext* cx, const TableDesc& desc, HandleWasmTableObject maybeObject)
 {
     // The raw element type of a Table depends on whether it is external: an
     // external table can contain functions from multiple instances and thus
     // must store an additional instance pointer in each element.
     UniqueByteArray array;
-    if (desc.external)
+    if (desc.external) {
         array.reset((uint8_t*)cx->pod_calloc<ExternalTableElem>(desc.limits.initial));
-    else
+    } else {
         array.reset((uint8_t*)cx->pod_calloc<void*>(desc.limits.initial));
-    if (!array)
+    }
+    if (!array) {
         return nullptr;
+    }
 
     return SharedTable(cx->new_<Table>(cx, desc, maybeObject, std::move(array)));
 }
 
 void
 Table::tracePrivate(JSTracer* trc)
 {
     // If this table has a WasmTableObject, then this method is only called by
@@ -68,36 +70,38 @@ Table::tracePrivate(JSTracer* trc)
     if (maybeObject_) {
         MOZ_ASSERT(!gc::IsAboutToBeFinalized(&maybeObject_));
         TraceEdge(trc, &maybeObject_, "wasm table object");
     }
 
     if (external_) {
         ExternalTableElem* array = externalArray();
         for (uint32_t i = 0; i < length_; i++) {
-            if (array[i].tls)
+            if (array[i].tls) {
                 array[i].tls->instance->trace(trc);
-            else
+            } else {
                 MOZ_ASSERT(!array[i].code);
+            }
         }
     }
 }
 
 void
 Table::trace(JSTracer* trc)
 {
     // The trace hook of WasmTableObject will call Table::tracePrivate at
     // which point we can mark the rest of the children. If there is no
     // WasmTableObject, call Table::tracePrivate directly. Redirecting through
     // the WasmTableObject avoids marking the entire Table on each incoming
     // edge (once per dependent Instance).
-    if (maybeObject_)
+    if (maybeObject_) {
         TraceEdge(trc, &maybeObject_, "wasm table object");
-    else
+    } else {
         tracePrivate(trc);
+    }
 }
 
 void**
 Table::internalArray() const
 {
     MOZ_ASSERT(!external_);
     return (void**)array_.get();
 }
@@ -109,36 +113,38 @@ Table::externalArray() const
     return (ExternalTableElem*)array_.get();
 }
 
 void
 Table::set(uint32_t index, void* code, const Instance* instance)
 {
     if (external_) {
         ExternalTableElem& elem = externalArray()[index];
-        if (elem.tls)
+        if (elem.tls) {
             JSObject::writeBarrierPre(elem.tls->instance->objectUnbarriered());
+        }
 
         elem.code = code;
         elem.tls = instance->tlsData();
 
         MOZ_ASSERT(elem.tls->instance->objectUnbarriered()->isTenured(),
                    "no writeBarrierPost (Table::set)");
     } else {
         internalArray()[index] = code;
     }
 }
 
 void
 Table::setNull(uint32_t index)
 {
     // Only external tables can set elements to null after initialization.
     ExternalTableElem& elem = externalArray()[index];
-    if (elem.tls)
+    if (elem.tls) {
         JSObject::writeBarrierPre(elem.tls->instance->objectUnbarriered());
+    }
 
     elem.code = nullptr;
     elem.tls = nullptr;
 }
 
 void
 Table::copy(uint32_t dstIndex, uint32_t srcIndex)
 {
@@ -163,47 +169,52 @@ Table::copy(uint32_t dstIndex, uint32_t 
     }
 }
 
 uint32_t
 Table::grow(uint32_t delta, JSContext* cx)
 {
     // This isn't just an optimization: movingGrowable() assumes that
     // onMovingGrowTable does not fire when length == maximum.
-    if (!delta)
+    if (!delta) {
         return length_;
+    }
 
     uint32_t oldLength = length_;
 
     CheckedInt<uint32_t> newLength = oldLength;
     newLength += delta;
-    if (!newLength.isValid())
+    if (!newLength.isValid()) {
         return -1;
+    }
 
-    if (maximum_ && newLength.value() > maximum_.value())
+    if (maximum_ && newLength.value() > maximum_.value()) {
         return -1;
+    }
 
     MOZ_ASSERT(movingGrowable());
 
     JSRuntime* rt = cx->runtime();  // Use JSRuntime's MallocProvider to avoid throwing.
 
     // Note that realloc does not release array_'s pointee (which is returned by
     // externalArray()) on failure which is exactly what we need here.
     ExternalTableElem* newArray = rt->pod_realloc(externalArray(), length_, newLength.value());
-    if (!newArray)
+    if (!newArray) {
         return -1;
+    }
     Unused << array_.release();
     array_.reset((uint8_t*)newArray);
 
     // Realloc does not zero the delta for us.
     PodZero(newArray + length_, delta);
     length_ = newLength.value();
 
-    for (InstanceSet::Range r = observers_.all(); !r.empty(); r.popFront())
+    for (InstanceSet::Range r = observers_.all(); !r.empty(); r.popFront()) {
         r.front()->instance().onMovingGrowTable();
+    }
 
     return oldLength;
 }
 
 bool
 Table::movingGrowable() const
 {
     return !maximum_ || length_ < maximum_.value();
--- a/js/src/wasm/WasmTextToBinary.cpp
+++ b/js/src/wasm/WasmTextToBinary.cpp
@@ -501,121 +501,139 @@ IsHexDigit(char c, uint8_t* value)
     return false;
 }
 
 static WasmToken
 LexHexFloatLiteral(const char16_t* begin, const char16_t* end, const char16_t** curp)
 {
     const char16_t* cur = begin;
 
-    if (cur != end && (*cur == '-' || *cur == '+'))
+    if (cur != end && (*cur == '-' || *cur == '+')) {
         cur++;
+    }
 
     MOZ_ASSERT(cur != end && *cur == '0');
     cur++;
     MOZ_ASSERT(cur != end && *cur == 'x');
     cur++;
 
     uint8_t digit;
-    while (cur != end && IsHexDigit(*cur, &digit))
+    while (cur != end && IsHexDigit(*cur, &digit)) {
+        cur++;
+    }
+
+    if (cur != end && *cur == '.') {
         cur++;
-
-    if (cur != end && *cur == '.')
+    }
+
+    while (cur != end && IsHexDigit(*cur, &digit)) {
         cur++;
-
-    while (cur != end && IsHexDigit(*cur, &digit))
-        cur++;
+    }
 
     if (cur != end && *cur == 'p') {
         cur++;
 
-        if (cur != end && (*cur == '-' || *cur == '+'))
+        if (cur != end && (*cur == '-' || *cur == '+')) {
             cur++;
-
-        while (cur != end && IsWasmDigit(*cur))
+        }
+
+        while (cur != end && IsWasmDigit(*cur)) {
             cur++;
+        }
     }
 
     *curp = cur;
     return WasmToken(WasmToken::HexNumber, begin, cur);
 }
 
 static WasmToken
 LexDecFloatLiteral(const char16_t* begin, const char16_t* end, const char16_t** curp)
 {
     const char16_t* cur = begin;
 
-    if (cur != end && (*cur == '-' || *cur == '+'))
+    if (cur != end && (*cur == '-' || *cur == '+')) {
         cur++;
-
-    while (cur != end && IsWasmDigit(*cur))
+    }
+
+    while (cur != end && IsWasmDigit(*cur)) {
         cur++;
-
-    if (cur != end && *cur == '.')
+    }
+
+    if (cur != end && *cur == '.') {
         cur++;
-
-    while (cur != end && IsWasmDigit(*cur))
+    }
+
+    while (cur != end && IsWasmDigit(*cur)) {
         cur++;
+    }
 
     if (cur != end && *cur == 'e') {
         cur++;
 
-        if (cur != end && (*cur == '-' || *cur == '+'))
+        if (cur != end && (*cur == '-' || *cur == '+')) {
             cur++;
-
-        while (cur != end && IsWasmDigit(*cur))
+        }
+
+        while (cur != end && IsWasmDigit(*cur)) {
             cur++;
+        }
     }
 
     *curp = cur;
     return WasmToken(WasmToken::DecNumber, begin, cur);
 }
 
 static bool
 ConsumeTextByte(const char16_t** curp, const char16_t* end, uint8_t* byte = nullptr)
 {
     const char16_t*& cur = *curp;
     MOZ_ASSERT(cur != end);
 
     if (*cur != '\\') {
-        if (byte)
+        if (byte) {
             *byte = *cur;
+        }
         cur++;
         return true;
     }
 
-    if (++cur == end)
-        return false;
+    if (++cur == end) {
+        return false;
+    }
 
     uint8_t u8;
     switch (*cur) {
       case 'n': u8 = '\n'; break;
       case 't': u8 = '\t'; break;
       case '\\': u8 = '\\'; break;
       case '\"': u8 = '\"'; break;
       case '\'': u8 = '\''; break;
       default: {
         uint8_t highNibble;
-        if (!IsHexDigit(*cur, &highNibble))
+        if (!IsHexDigit(*cur, &highNibble)) {
             return false;
-
-        if (++cur == end)
+        }
+
+        if (++cur == end) {
             return false;
+        }
 
         uint8_t lowNibble;
-        if (!IsHexDigit(*cur, &lowNibble))
+        if (!IsHexDigit(*cur, &lowNibble)) {
             return false;
+        }
 
         u8 = lowNibble | (highNibble << 4);
         break;
       }
     }
 
-    if (byte)
+    if (byte) {
         *byte = u8;
+    }
     cur++;
     return true;
 }
 
 namespace {
 
 class WasmTokenStream
 {
@@ -627,18 +645,19 @@ class WasmTokenStream
     unsigned line_;
     uint32_t lookaheadIndex_;
     uint32_t lookaheadDepth_;
     WasmToken lookahead_[LookaheadSize];
 
     bool consume(const char16_t* match) {
         const char16_t* p = cur_;
         for (; *match; p++, match++) {
-            if (p == end_ || *p != *match)
+            if (p == end_ || *p != *match) {
                 return false;
+            }
         }
         cur_ = p;
         return true;
     }
     WasmToken fail(const char16_t* begin) const {
         return WasmToken(begin);
     }
 
@@ -693,44 +712,48 @@ class WasmTokenStream
         if (peek().kind() == kind) {
             *token = get();
             return true;
         }
         return false;
     }
     bool getIf(WasmToken::Kind kind) {
         WasmToken token;
-        if (getIf(kind, &token))
+        if (getIf(kind, &token)) {
             return true;
+        }
         return false;
     }
     AstName getIfName() {
         WasmToken token;
-        if (getIf(WasmToken::Name, &token))
+        if (getIf(WasmToken::Name, &token)) {
             return token.name();
+        }
         return AstName();
     }
     bool getIfRef(AstRef* ref) {
         WasmToken token = peek();
-        if (token.kind() == WasmToken::Name || token.kind() == WasmToken::Index)
+        if (token.kind() == WasmToken::Name || token.kind() == WasmToken::Index) {
             return matchRef(ref, nullptr);
+        }
         return false;
     }
     bool getIfOpcode(WasmToken* token) {
         *token = peek();
         if (token->isOpcode()) {
             (void)get();
             return true;
         }
         return false;
     }
     bool match(WasmToken::Kind expect, WasmToken* token, UniqueChars* error) {
         *token = get();
-        if (token->kind() == expect)
+        if (token->kind() == expect) {
             return true;
+        }
         generateError(*token, error);
         return false;
     }
     bool match(WasmToken::Kind expect, UniqueChars* error) {
         WasmToken token;
         return match(expect, &token, error);
     }
     bool matchRef(AstRef* ref, UniqueChars* error) {
@@ -754,115 +777,131 @@ class WasmTokenStream
 };
 
 } // end anonymous namespace
 
 WasmToken
 WasmTokenStream::nan(const char16_t* begin)
 {
     if (consume(u":")) {
-        if (!consume(u"0x"))
+        if (!consume(u"0x")) {
             return fail(begin);
+        }
 
         uint8_t digit;
-        while (cur_ != end_ && IsHexDigit(*cur_, &digit))
+        while (cur_ != end_ && IsHexDigit(*cur_, &digit)) {
             cur_++;
+        }
     }
 
     return WasmToken(WasmToken::NaN, begin, cur_);
 }
 
 WasmToken
 WasmTokenStream::literal(const char16_t* begin)
 {
     CheckedInt<uint64_t> u = 0;
     if (consume(u"0x")) {
-        if (cur_ == end_)
+        if (cur_ == end_) {
             return fail(begin);
+        }
 
         do {
-            if (*cur_ == '.' || *cur_ == 'p')
+            if (*cur_ == '.' || *cur_ == 'p') {
                 return LexHexFloatLiteral(begin, end_, &cur_);
+            }
 
             uint8_t digit;
-            if (!IsHexDigit(*cur_, &digit))
+            if (!IsHexDigit(*cur_, &digit)) {
                 break;
+            }
 
             u *= 16;
             u += digit;
-            if (!u.isValid())
+            if (!u.isValid()) {
                 return LexHexFloatLiteral(begin, end_, &cur_);
+            }
 
             cur_++;
         } while (cur_ != end_);
 
         if (*begin == '-') {
             uint64_t value = u.value();
-            if (value == 0)
+            if (value == 0) {
                 return WasmToken(WasmToken::NegativeZero, begin, cur_);
-            if (value > uint64_t(INT64_MIN))
+            }
+            if (value > uint64_t(INT64_MIN)) {
                 return LexHexFloatLiteral(begin, end_, &cur_);
+            }
 
             value = -value;
             return WasmToken(int64_t(value), begin, cur_);
         }
     } else {
         while (cur_ != end_) {
-            if (*cur_ == '.' || *cur_ == 'e')
+            if (*cur_ == '.' || *cur_ == 'e') {
                 return LexDecFloatLiteral(begin, end_, &cur_);
-
-            if (!IsWasmDigit(*cur_))
+            }
+
+            if (!IsWasmDigit(*cur_)) {
                 break;
+            }
 
             u *= 10;
             u += *cur_ - '0';
-            if (!u.isValid())
+            if (!u.isValid()) {
                 return LexDecFloatLiteral(begin, end_, &cur_);
+            }
 
             cur_++;
         }
 
         if (*begin == '-') {
             uint64_t value = u.value();
-            if (value == 0)
+            if (value == 0) {
                 return WasmToken(WasmToken::NegativeZero, begin, cur_);
-            if (value > uint64_t(INT64_MIN))
+            }
+            if (value > uint64_t(INT64_MIN)) {
                 return LexDecFloatLiteral(begin, end_, &cur_);
+            }
 
             value = -value;
             return WasmToken(int64_t(value), begin, cur_);
         }
     }
 
     CheckedInt<uint32_t> index = u.value();
-    if (index.isValid())
+    if (index.isValid()) {
         return WasmToken(index.value(), begin, cur_);
+    }
 
     return WasmToken(u.value(), begin, cur_);
 }
 
 void
 WasmTokenStream::skipSpaces()
 {
     while (cur_ != end_) {
         char16_t ch = *cur_;
         if (ch == ';' && consume(u";;")) {
             // Skipping single line comment.
-            while (cur_ != end_ && !IsWasmNewLine(*cur_))
+            while (cur_ != end_ && !IsWasmNewLine(*cur_)) {
                 cur_++;
+            }
         } else if (ch == '(' && consume(u"(;")) {
             // Skipping multi-line and possibly nested comments.
             size_t level = 1;
             while (cur_ != end_) {
                 char16_t ch = *cur_;
                 if (ch == '(' && consume(u"(;")) {
                     level++;
                 } else if (ch == ';' && consume(u";)")) {
-                    if (--level == 0)
+                    if (--level == 0) {
                         break;
+                    }
                 } else {
                     cur_++;
                     if (IsWasmNewLine(ch)) {
                         lineStart_ = cur_;
                         line_++;
                     }
                 }
             }
@@ -877,924 +916,1215 @@ WasmTokenStream::skipSpaces()
     }
 }
 
 WasmToken
 WasmTokenStream::next()
 {
     skipSpaces();
 
-    if (cur_ == end_)
+    if (cur_ == end_) {
         return WasmToken(WasmToken::EndOfFile, cur_, cur_);
+    }
 
     const char16_t* begin = cur_;
     switch (*begin) {
       case '"':
         cur_++;
         while (true) {
-            if (cur_ == end_)
+            if (cur_ == end_) {
                 return fail(begin);
-            if (*cur_ == '"')
+            }
+            if (*cur_ == '"') {
                 break;
-            if (!ConsumeTextByte(&cur_, end_))
+            }
+            if (!ConsumeTextByte(&cur_, end_)) {
                 return fail(begin);
+            }
         }
         cur_++;
         return WasmToken(WasmToken::Text, begin, cur_);
 
       case '$':
         cur_++;
-        while (cur_ != end_ && IsNameAfterDollar(*cur_))
+        while (cur_ != end_ && IsNameAfterDollar(*cur_)) {
             cur_++;
+        }
         return WasmToken(WasmToken::Name, begin, cur_);
 
       case '(':
         cur_++;
         return WasmToken(WasmToken::OpenParen, begin, cur_);
 
       case ')':
         cur_++;
         return WasmToken(WasmToken::CloseParen, begin, cur_);
 
       case '=':
         cur_++;
         return WasmToken(WasmToken::Equal, begin, cur_);
 
       case '+': case '-':
         cur_++;
-        if (consume(u"infinity"))
+        if (consume(u"infinity")) {
             return WasmToken(WasmToken::Infinity, begin, cur_);
-        if (consume(u"nan"))
+        }
+        if (consume(u"nan")) {
             return nan(begin);
-        if (!IsWasmDigit(*cur_))
+        }
+        if (!IsWasmDigit(*cur_)) {
             break;
+        }
         MOZ_FALLTHROUGH;
       case '0': case '1': case '2': case '3': case '4':
       case '5': case '6': case '7': case '8': case '9':
         return literal(begin);
 
       case 'a':
-        if (consume(u"align"))
+        if (consume(u"align")) {
             return WasmToken(WasmToken::Align, begin, cur_);
-        if (consume(u"anyfunc"))
+        }
+        if (consume(u"anyfunc")) {
             return WasmToken(WasmToken::AnyFunc, begin, cur_);
-        if (consume(u"anyref"))
+        }
+        if (consume(u"anyref")) {
             return WasmToken(WasmToken::ValueType, ValType::AnyRef, begin, cur_);
+        }
 #ifdef ENABLE_WASM_THREAD_OPS
-        if (consume(u"atomic.wake"))
+        if (consume(u"atomic.wake")) {
             return WasmToken(WasmToken::Wake, ThreadOp::Wake, begin, cur_);
+        }
 #endif
         break;
 
       case 'b':
-        if (consume(u"block"))
+        if (consume(u"block")) {
             return WasmToken(WasmToken::Block, begin, cur_);
+        }
         if (consume(u"br")) {
-            if (consume(u"_table"))
+            if (consume(u"_table")) {
                 return WasmToken(WasmToken::BrTable, begin, cur_);
-            if (consume(u"_if"))
+            }
+            if (consume(u"_if")) {
                 return WasmToken(WasmToken::BrIf, begin, cur_);
+            }
             return WasmToken(WasmToken::Br, begin, cur_);
         }
         break;
 
       case 'c':
         if (consume(u"call")) {
-            if (consume(u"_indirect"))
+            if (consume(u"_indirect")) {
                 return WasmToken(WasmToken::CallIndirect, begin, cur_);
+            }
             return WasmToken(WasmToken::Call, begin, cur_);
         }
-        if (consume(u"current_memory"))
+        if (consume(u"current_memory")) {
             return WasmToken(WasmToken::CurrentMemory, begin, cur_);
+        }
         break;
 
       case 'd':
-        if (consume(u"data"))
+        if (consume(u"data")) {
             return WasmToken(WasmToken::Data, begin, cur_);
-        if (consume(u"drop"))
+        }
+        if (consume(u"drop")) {
             return WasmToken(WasmToken::Drop, begin, cur_);
+        }
         break;
 
       case 'e':
-        if (consume(u"elem"))
+        if (consume(u"elem")) {
             return WasmToken(WasmToken::Elem, begin, cur_);
-        if (consume(u"else"))
+        }
+        if (consume(u"else")) {
             return WasmToken(WasmToken::Else, begin, cur_);
-        if (consume(u"end"))
+        }
+        if (consume(u"end")) {
             return WasmToken(WasmToken::End, begin, cur_);
-        if (consume(u"export"))
+        }
+        if (consume(u"export")) {
             return WasmToken(WasmToken::Export, begin, cur_);
+        }
         break;
 
       case 'f':
-        if (consume(u"field"))
+        if (consume(u"field")) {
             return WasmToken(WasmToken::Field, begin, cur_);
-
-        if (consume(u"func"))
+        }
+
+        if (consume(u"func")) {
             return WasmToken(WasmToken::Func, begin, cur_);
+        }
 
         if (consume(u"f32")) {
-            if (!consume(u"."))
+            if (!consume(u".")) {
                 return WasmToken(WasmToken::ValueType, ValType::F32, begin, cur_);
+            }
 
             switch (*cur_) {
               case 'a':
-                if (consume(u"abs"))
+                if (consume(u"abs")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Abs, begin, cur_);
-                if (consume(u"add"))
+                }
+                if (consume(u"add")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Add, begin, cur_);
+                }
                 break;
               case 'c':
-                if (consume(u"ceil"))
+                if (consume(u"ceil")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Ceil, begin, cur_);
-                if (consume(u"const"))
+                }
+                if (consume(u"const")) {
                     return WasmToken(WasmToken::Const, ValType::F32, begin, cur_);
+                }
                 if (consume(u"convert_s/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32ConvertSI32,
                                      begin, cur_);
                 }
                 if (consume(u"convert_u/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32ConvertUI32,
                                      begin, cur_);
                 }
                 if (consume(u"convert_s/i64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32ConvertSI64,
                                      begin, cur_);
                 }
                 if (consume(u"convert_u/i64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32ConvertUI64,
                                      begin, cur_);
                 }
-                if (consume(u"copysign"))
+                if (consume(u"copysign")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32CopySign, begin, cur_);
+                }
                 break;
               case 'd':
-                if (consume(u"demote/f64"))
+                if (consume(u"demote/f64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32DemoteF64,
                                      begin, cur_);
-                if (consume(u"div"))
+                }
+                if (consume(u"div")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Div, begin, cur_);
+                }
                 break;
               case 'e':
-                if (consume(u"eq"))
+                if (consume(u"eq")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Eq, begin, cur_);
+                }
                 break;
               case 'f':
-                if (consume(u"floor"))
+                if (consume(u"floor")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Floor, begin, cur_);
+                }
                 break;
               case 'g':
-                if (consume(u"ge"))
+                if (consume(u"ge")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Ge, begin, cur_);
-                if (consume(u"gt"))
+                }
+                if (consume(u"gt")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Gt, begin, cur_);
+                }
                 break;
               case 'l':
-                if (consume(u"le"))
+                if (consume(u"le")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Le, begin, cur_);
-                if (consume(u"lt"))
+                }
+                if (consume(u"lt")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Lt, begin, cur_);
-                if (consume(u"load"))
+                }
+                if (consume(u"load")) {
                     return WasmToken(WasmToken::Load, Op::F32Load, begin, cur_);
+                }
                 break;
               case 'm':
-                if (consume(u"max"))
+                if (consume(u"max")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Max, begin, cur_);
-                if (consume(u"min"))
+                }
+                if (consume(u"min")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Min, begin, cur_);
-                if (consume(u"mul"))
+                }
+                if (consume(u"mul")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Mul, begin, cur_);
+                }
                 break;
               case 'n':
-                if (consume(u"nearest"))
+                if (consume(u"nearest")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Nearest, begin, cur_);
-                if (consume(u"neg"))
+                }
+                if (consume(u"neg")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Neg, begin, cur_);
-                if (consume(u"ne"))
+                }
+                if (consume(u"ne")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F32Ne, begin, cur_);
+                }
                 break;
               case 'r':
-                if (consume(u"reinterpret/i32"))
+                if (consume(u"reinterpret/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F32ReinterpretI32,
                                      begin, cur_);
+                }
                 break;
               case 's':
-                if (consume(u"sqrt"))
+                if (consume(u"sqrt")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Sqrt, begin, cur_);
-                if (consume(u"sub"))
+                }
+                if (consume(u"sub")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F32Sub, begin, cur_);
-                if (consume(u"store"))
+                }
+                if (consume(u"store")) {
                     return WasmToken(WasmToken::Store, Op::F32Store, begin, cur_);
+                }
                 break;
               case 't':
-                if (consume(u"trunc"))
+                if (consume(u"trunc")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F32Trunc, begin, cur_);
+                }
                 break;
             }
             break;
         }
         if (consume(u"f64")) {
-            if (!consume(u"."))
+            if (!consume(u".")) {
                 return WasmToken(WasmToken::ValueType, ValType::F64, begin, cur_);
+            }
 
             switch (*cur_) {
               case 'a':
-                if (consume(u"abs"))
+                if (consume(u"abs")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Abs, begin, cur_);
-                if (consume(u"add"))
+                }
+                if (consume(u"add")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Add, begin, cur_);
+                }
                 break;
               case 'c':
-                if (consume(u"ceil"))
+                if (consume(u"ceil")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Ceil, begin, cur_);
-                if (consume(u"const"))
+                }
+                if (consume(u"const")) {
                     return WasmToken(WasmToken::Const, ValType::F64, begin, cur_);
+                }
                 if (consume(u"convert_s/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F64ConvertSI32,
                                      begin, cur_);
                 }
                 if (consume(u"convert_u/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F64ConvertUI32,
                                      begin, cur_);
                 }
                 if (consume(u"convert_s/i64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F64ConvertSI64,
                                      begin, cur_);
                 }
                 if (consume(u"convert_u/i64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F64ConvertUI64,
                                      begin, cur_);
                 }
-                if (consume(u"copysign"))
+                if (consume(u"copysign")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64CopySign, begin, cur_);
+                }
                 break;
               case 'd':
-                if (consume(u"div"))
+                if (consume(u"div")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Div, begin, cur_);
+                }
                 break;
               case 'e':
-                if (consume(u"eq"))
+                if (consume(u"eq")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Eq, begin, cur_);
+                }
                 break;
               case 'f':
-                if (consume(u"floor"))
+                if (consume(u"floor")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Floor, begin, cur_);
+                }
                 break;
               case 'g':
-                if (consume(u"ge"))
+                if (consume(u"ge")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Ge, begin, cur_);
-                if (consume(u"gt"))
+                }
+                if (consume(u"gt")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Gt, begin, cur_);
+                }
                 break;
               case 'l':
-                if (consume(u"le"))
+                if (consume(u"le")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Le, begin, cur_);
-                if (consume(u"lt"))
+                }
+                if (consume(u"lt")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Lt, begin, cur_);
-                if (consume(u"load"))
+                }
+                if (consume(u"load")) {
                     return WasmToken(WasmToken::Load, Op::F64Load, begin, cur_);
+                }
                 break;
               case 'm':
-                if (consume(u"max"))
+                if (consume(u"max")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Max, begin, cur_);
-                if (consume(u"min"))
+                }
+                if (consume(u"min")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Min, begin, cur_);
-                if (consume(u"mul"))
+                }
+                if (consume(u"mul")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Mul, begin, cur_);
+                }
                 break;
               case 'n':
-                if (consume(u"nearest"))
+                if (consume(u"nearest")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Nearest, begin, cur_);
-                if (consume(u"neg"))
+                }
+                if (consume(u"neg")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Neg, begin, cur_);
-                if (consume(u"ne"))
+                }
+                if (consume(u"ne")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::F64Ne, begin, cur_);
+                }
                 break;
               case 'p':
-                if (consume(u"promote/f32"))
+                if (consume(u"promote/f32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::F64PromoteF32,
                                      begin, cur_);
+                }
                 break;
               case 'r':
-                if (consume(u"reinterpret/i64"))
+                if (consume(u"reinterpret/i64")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64ReinterpretI64,
                                      begin, cur_);
+                }
                 break;
               case 's':
-                if (consume(u"sqrt"))
+                if (consume(u"sqrt")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Sqrt, begin, cur_);
-                if (consume(u"sub"))
+                }
+                if (consume(u"sub")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::F64Sub, begin, cur_);
-                if (consume(u"store"))
+                }
+                if (consume(u"store")) {
                     return WasmToken(WasmToken::Store, Op::F64Store, begin, cur_);
+                }
                 break;
               case 't':
-                if (consume(u"trunc"))
+                if (consume(u"trunc")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::F64Trunc, begin, cur_);
+                }
                 break;
             }
             break;
         }
         break;
 
       case 'g':
 #ifdef ENABLE_WASM_GC
-        if (consume(u"gc_feature_opt_in"))
+        if (consume(u"gc_feature_opt_in")) {
             return WasmToken(WasmToken::GcFeatureOptIn, begin, cur_);
+        }
 #endif
-        if (consume(u"get_global"))
+        if (consume(u"get_global")) {
             return WasmToken(WasmToken::GetGlobal, begin, cur_);
-        if (consume(u"get_local"))
+        }
+        if (consume(u"get_local")) {
             return WasmToken(WasmToken::GetLocal, begin, cur_);
-        if (consume(u"global"))
+        }
+        if (consume(u"global")) {
             return WasmToken(WasmToken::Global, begin, cur_);
-        if (consume(u"grow_memory"))
+        }
+        if (consume(u"grow_memory")) {
             return WasmToken(WasmToken::GrowMemory, begin, cur_);
+        }
         break;
 
       case 'i':
         if (consume(u"i32")) {
-            if (!consume(u"."))
+            if (!consume(u".")) {
                 return WasmToken(WasmToken::ValueType, ValType::I32, begin, cur_);
+            }
 
             switch (*cur_) {
               case 'a':
-                if (consume(u"add"))
+                if (consume(u"add")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Add, begin, cur_);
-                if (consume(u"and"))
+                }
+                if (consume(u"and")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32And, begin, cur_);
+                }
 #ifdef ENABLE_WASM_THREAD_OPS
                 if (consume(u"atomic.")) {
-                    if (consume(u"rmw8_u.add"))
+                    if (consume(u"rmw8_u.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAdd8U, begin, cur_);
-                    if (consume(u"rmw16_u.add"))
+                    }
+                    if (consume(u"rmw16_u.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAdd16U, begin, cur_);
-                    if (consume(u"rmw.add"))
+                    }
+                    if (consume(u"rmw.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAdd, begin, cur_);
-                    if (consume(u"rmw8_u.and"))
+                    }
+                    if (consume(u"rmw8_u.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAnd8U, begin, cur_);
-                    if (consume(u"rmw16_u.and"))
+                    }
+                    if (consume(u"rmw16_u.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAnd16U, begin, cur_);
-                    if (consume(u"rmw.and"))
+                    }
+                    if (consume(u"rmw.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicAnd, begin, cur_);
-                    if (consume(u"rmw8_u.cmpxchg"))
+                    }
+                    if (consume(u"rmw8_u.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I32AtomicCmpXchg8U, begin, cur_);
-                    if (consume(u"rmw16_u.cmpxchg"))
+                    }
+                    if (consume(u"rmw16_u.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I32AtomicCmpXchg16U, begin, cur_);
-                    if (consume(u"rmw.cmpxchg"))
+                    }
+                    if (consume(u"rmw.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I32AtomicCmpXchg, begin, cur_);
-                    if (consume(u"load8_u"))
+                    }
+                    if (consume(u"load8_u")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I32AtomicLoad8U, begin, cur_);
-                    if (consume(u"load16_u"))
+                    }
+                    if (consume(u"load16_u")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I32AtomicLoad16U, begin, cur_);
-                    if (consume(u"load"))
+                    }
+                    if (consume(u"load")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I32AtomicLoad, begin, cur_);
-                    if (consume(u"rmw8_u.or"))
+                    }
+                    if (consume(u"rmw8_u.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicOr8U, begin, cur_);
-                    if (consume(u"rmw16_u.or"))
+                    }
+                    if (consume(u"rmw16_u.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicOr16U, begin, cur_);
-                    if (consume(u"rmw.or"))
+                    }
+                    if (consume(u"rmw.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicOr, begin, cur_);
-                    if (consume(u"store8_u"))
+                    }
+                    if (consume(u"store8_u")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I32AtomicStore8U, begin, cur_);
-                    if (consume(u"store16_u"))
+                    }
+                    if (consume(u"store16_u")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I32AtomicStore16U, begin, cur_);
-                    if (consume(u"store"))
+                    }
+                    if (consume(u"store")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I32AtomicStore, begin, cur_);
-                    if (consume(u"rmw8_u.sub"))
+                    }
+                    if (consume(u"rmw8_u.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicSub8U, begin, cur_);
-                    if (consume(u"rmw16_u.sub"))
+                    }
+                    if (consume(u"rmw16_u.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicSub16U, begin, cur_);
-                    if (consume(u"rmw.sub"))
+                    }
+                    if (consume(u"rmw.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicSub, begin, cur_);
-                    if (consume(u"rmw8_u.xor"))
+                    }
+                    if (consume(u"rmw8_u.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXor8U, begin, cur_);
-                    if (consume(u"rmw16_u.xor"))
+                    }
+                    if (consume(u"rmw16_u.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXor16U, begin, cur_);
-                    if (consume(u"rmw.xor"))
+                    }
+                    if (consume(u"rmw.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXor, begin, cur_);
-                    if (consume(u"rmw8_u.xchg"))
+                    }
+                    if (consume(u"rmw8_u.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXchg8U, begin, cur_);
-                    if (consume(u"rmw16_u.xchg"))
+                    }
+                    if (consume(u"rmw16_u.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXchg16U, begin, cur_);
-                    if (consume(u"rmw.xchg"))
+                    }
+                    if (consume(u"rmw.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I32AtomicXchg, begin, cur_);
-                    if (consume(u"wait"))
+                    }
+                    if (consume(u"wait")) {
                         return WasmToken(WasmToken::Wait, ThreadOp::I32Wait, begin, cur_);
+                    }
                 }
 #endif // ENABLE_WASM_THREAD_OPS
                 break;
               case 'c':
-                if (consume(u"const"))
+                if (consume(u"const")) {
                     return WasmToken(WasmToken::Const, ValType::I32, begin, cur_);
-                if (consume(u"clz"))
+                }
+                if (consume(u"clz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I32Clz, begin, cur_);
-                if (consume(u"ctz"))
+                }
+                if (consume(u"ctz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I32Ctz, begin, cur_);
+                }
                 break;
               case 'd':
-                if (consume(u"div_s"))
+                if (consume(u"div_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32DivS, begin, cur_);
-                if (consume(u"div_u"))
+                }
+                if (consume(u"div_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32DivU, begin, cur_);
+                }
                 break;
               case 'e':
-                if (consume(u"eqz"))
+                if (consume(u"eqz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I32Eqz, begin, cur_);
-                if (consume(u"eq"))
+                }
+                if (consume(u"eq")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32Eq, begin, cur_);
-                if (consume(u"extend8_s"))
+                }
+                if (consume(u"extend8_s")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32Extend8S, begin, cur_);
-                if (consume(u"extend16_s"))
+                }
+                if (consume(u"extend16_s")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32Extend16S, begin, cur_);
+                }
                 break;
               case 'g':
-                if (consume(u"ge_s"))
+                if (consume(u"ge_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32GeS, begin, cur_);
-                if (consume(u"ge_u"))
+                }
+                if (consume(u"ge_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32GeU, begin, cur_);
-                if (consume(u"gt_s"))
+                }
+                if (consume(u"gt_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32GtS, begin, cur_);
-                if (consume(u"gt_u"))
+                }
+                if (consume(u"gt_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32GtU, begin, cur_);
+                }
                 break;
               case 'l':
-                if (consume(u"le_s"))
+                if (consume(u"le_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32LeS, begin, cur_);
-                if (consume(u"le_u"))
+                }
+                if (consume(u"le_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32LeU, begin, cur_);
-                if (consume(u"lt_s"))
+                }
+                if (consume(u"lt_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32LtS, begin, cur_);
-                if (consume(u"lt_u"))
+                }
+                if (consume(u"lt_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32LtU, begin, cur_);
+                }
                 if (consume(u"load")) {
-                    if (IsWasmSpace(*cur_))
+                    if (IsWasmSpace(*cur_)) {
                         return WasmToken(WasmToken::Load, Op::I32Load, begin, cur_);
-                    if (consume(u"8_s"))
+                    }
+                    if (consume(u"8_s")) {
                         return WasmToken(WasmToken::Load, Op::I32Load8S, begin, cur_);
-                    if (consume(u"8_u"))
+                    }
+                    if (consume(u"8_u")) {
                         return WasmToken(WasmToken::Load, Op::I32Load8U, begin, cur_);
-                    if (consume(u"16_s"))
+                    }
+                    if (consume(u"16_s")) {
                         return WasmToken(WasmToken::Load, Op::I32Load16S, begin, cur_);
-                    if (consume(u"16_u"))
+                    }
+                    if (consume(u"16_u")) {
                         return WasmToken(WasmToken::Load, Op::I32Load16U, begin, cur_);
+                    }
                     break;
                 }
                 break;
               case 'm':
-                if (consume(u"mul"))
+                if (consume(u"mul")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Mul, begin, cur_);
+                }
                 break;
               case 'n':
-                if (consume(u"ne"))
+                if (consume(u"ne")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I32Ne, begin, cur_);
+                }
                 break;
               case 'o':
-                if (consume(u"or"))
+                if (consume(u"or")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Or, begin, cur_);
+                }
                 break;
               case 'p':
-                if (consume(u"popcnt"))
+                if (consume(u"popcnt")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I32Popcnt, begin, cur_);
+                }
                 break;
               case 'r':
-                if (consume(u"reinterpret/f32"))
+                if (consume(u"reinterpret/f32")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I32ReinterpretF32,
                                      begin, cur_);
-                if (consume(u"rem_s"))
+                }
+                if (consume(u"rem_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32RemS, begin, cur_);
-                if (consume(u"rem_u"))
+                }
+                if (consume(u"rem_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32RemU, begin, cur_);
-                if (consume(u"rotr"))
+                }
+                if (consume(u"rotr")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Rotr, begin, cur_);
-                if (consume(u"rotl"))
+                }
+                if (consume(u"rotl")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Rotl, begin, cur_);
+                }
                 break;
               case 's':
-                if (consume(u"sub"))
+                if (consume(u"sub")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Sub, begin, cur_);
-                if (consume(u"shl"))
+                }
+                if (consume(u"shl")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Shl, begin, cur_);
-                if (consume(u"shr_s"))
+                }
+                if (consume(u"shr_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32ShrS, begin, cur_);
-                if (consume(u"shr_u"))
+                }
+                if (consume(u"shr_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32ShrU, begin, cur_);
+                }
                 if (consume(u"store")) {
-                    if (IsWasmSpace(*cur_))
+                    if (IsWasmSpace(*cur_)) {
                         return WasmToken(WasmToken::Store, Op::I32Store, begin, cur_);
-                    if (consume(u"8"))
+                    }
+                    if (consume(u"8")) {
                         return WasmToken(WasmToken::Store, Op::I32Store8, begin, cur_);
-                    if (consume(u"16"))
+                    }
+                    if (consume(u"16")) {
                         return WasmToken(WasmToken::Store, Op::I32Store16, begin, cur_);
+                    }
                     break;
                 }
                 break;
               case 't':
-                if (consume(u"trunc_s/f32"))
+                if (consume(u"trunc_s/f32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32TruncSF32,
                                      begin, cur_);
-                if (consume(u"trunc_s/f64"))
+                }
+                if (consume(u"trunc_s/f64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32TruncSF64,
                                      begin, cur_);
-                if (consume(u"trunc_u/f32"))
+                }
+                if (consume(u"trunc_u/f32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32TruncUF32,
                                      begin, cur_);
-                if (consume(u"trunc_u/f64"))
+                }
+                if (consume(u"trunc_u/f64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32TruncUF64,
                                      begin, cur_);
+                }
 #ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
-                if (consume(u"trunc_s:sat/f32"))
+                if (consume(u"trunc_s:sat/f32")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I32TruncSSatF32,
                                      begin, cur_);
-                if (consume(u"trunc_s:sat/f64"))
+                }
+                if (consume(u"trunc_s:sat/f64")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I32TruncSSatF64,
                                      begin, cur_);
-                if (consume(u"trunc_u:sat/f32"))
+                }
+                if (consume(u"trunc_u:sat/f32")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I32TruncUSatF32,
                                      begin, cur_);
-                if (consume(u"trunc_u:sat/f64"))
+                }
+                if (consume(u"trunc_u:sat/f64")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I32TruncUSatF64,
                                      begin, cur_);
+                }
 #endif
                 break;
               case 'w':
-                if (consume(u"wrap/i64"))
+                if (consume(u"wrap/i64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I32WrapI64,
                                      begin, cur_);
+                }
                 break;
               case 'x':
-                if (consume(u"xor"))
+                if (consume(u"xor")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I32Xor, begin, cur_);
+                }
                 break;
             }
             break;
         }
         if (consume(u"i64")) {
-            if (!consume(u"."))
+            if (!consume(u".")) {
                 return WasmToken(WasmToken::ValueType, ValType::I64, begin, cur_);
+            }
 
             switch (*cur_) {
               case 'a':
-                if (consume(u"add"))
+                if (consume(u"add")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Add, begin, cur_);
-                if (consume(u"and"))
+                }
+                if (consume(u"and")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64And, begin, cur_);
+                }
 #ifdef ENABLE_WASM_THREAD_OPS
                 if (consume(u"atomic.")) {
-                    if (consume(u"rmw8_u.add"))
+                    if (consume(u"rmw8_u.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAdd8U, begin, cur_);
-                    if (consume(u"rmw16_u.add"))
+                    }
+                    if (consume(u"rmw16_u.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAdd16U, begin, cur_);
-                    if (consume(u"rmw32_u.add"))
+                    }
+                    if (consume(u"rmw32_u.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAdd32U, begin, cur_);
-                    if (consume(u"rmw.add"))
+                    }
+                    if (consume(u"rmw.add")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAdd, begin, cur_);
-                    if (consume(u"rmw8_u.and"))
+                    }
+                    if (consume(u"rmw8_u.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAnd8U, begin, cur_);
-                    if (consume(u"rmw16_u.and"))
+                    }
+                    if (consume(u"rmw16_u.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAnd16U, begin, cur_);
-                    if (consume(u"rmw32_u.and"))
+                    }
+                    if (consume(u"rmw32_u.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAnd32U, begin, cur_);
-                    if (consume(u"rmw.and"))
+                    }
+                    if (consume(u"rmw.and")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicAnd, begin, cur_);
-                    if (consume(u"rmw8_u.cmpxchg"))
+                    }
+                    if (consume(u"rmw8_u.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I64AtomicCmpXchg8U, begin, cur_);
-                    if (consume(u"rmw16_u.cmpxchg"))
+                    }
+                    if (consume(u"rmw16_u.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I64AtomicCmpXchg16U, begin, cur_);
-                    if (consume(u"rmw32_u.cmpxchg"))
+                    }
+                    if (consume(u"rmw32_u.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I64AtomicCmpXchg32U, begin, cur_);
-                    if (consume(u"rmw.cmpxchg"))
+                    }
+                    if (consume(u"rmw.cmpxchg")) {
                         return WasmToken(WasmToken::AtomicCmpXchg, ThreadOp::I64AtomicCmpXchg, begin, cur_);
-                    if (consume(u"load8_u"))
+                    }
+                    if (consume(u"load8_u")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I64AtomicLoad8U, begin, cur_);
-                    if (consume(u"load16_u"))
+                    }
+                    if (consume(u"load16_u")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I64AtomicLoad16U, begin, cur_);
-                    if (consume(u"load32_u"))
+                    }
+                    if (consume(u"load32_u")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I64AtomicLoad32U, begin, cur_);
-                    if (consume(u"load"))
+                    }
+                    if (consume(u"load")) {
                         return WasmToken(WasmToken::AtomicLoad, ThreadOp::I64AtomicLoad, begin, cur_);
-                    if (consume(u"rmw8_u.or"))
+                    }
+                    if (consume(u"rmw8_u.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicOr8U, begin, cur_);
-                    if (consume(u"rmw16_u.or"))
+                    }
+                    if (consume(u"rmw16_u.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicOr16U, begin, cur_);
-                    if (consume(u"rmw32_u.or"))
+                    }
+                    if (consume(u"rmw32_u.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicOr32U, begin, cur_);
-                    if (consume(u"rmw.or"))
+                    }
+                    if (consume(u"rmw.or")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicOr, begin, cur_);
-                    if (consume(u"store8_u"))
+                    }
+                    if (consume(u"store8_u")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I64AtomicStore8U, begin, cur_);
-                    if (consume(u"store16_u"))
+                    }
+                    if (consume(u"store16_u")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I64AtomicStore16U, begin, cur_);
-                    if (consume(u"store32_u"))
+                    }
+                    if (consume(u"store32_u")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I64AtomicStore32U, begin, cur_);
-                    if (consume(u"store"))
+                    }
+                    if (consume(u"store")) {
                         return WasmToken(WasmToken::AtomicStore, ThreadOp::I64AtomicStore, begin, cur_);
-                    if (consume(u"rmw8_u.sub"))
+                    }
+                    if (consume(u"rmw8_u.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicSub8U, begin, cur_);
-                    if (consume(u"rmw16_u.sub"))
+                    }
+                    if (consume(u"rmw16_u.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicSub16U, begin, cur_);
-                    if (consume(u"rmw32_u.sub"))
+                    }
+                    if (consume(u"rmw32_u.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicSub32U, begin, cur_);
-                    if (consume(u"rmw.sub"))
+                    }
+                    if (consume(u"rmw.sub")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicSub, begin, cur_);
-                    if (consume(u"rmw8_u.xor"))
+                    }
+                    if (consume(u"rmw8_u.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXor8U, begin, cur_);
-                    if (consume(u"rmw16_u.xor"))
+                    }
+                    if (consume(u"rmw16_u.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXor16U, begin, cur_);
-                    if (consume(u"rmw32_u.xor"))
+                    }
+                    if (consume(u"rmw32_u.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXor32U, begin, cur_);
-                    if (consume(u"rmw.xor"))
+                    }
+                    if (consume(u"rmw.xor")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXor, begin, cur_);
-                    if (consume(u"rmw8_u.xchg"))
+                    }
+                    if (consume(u"rmw8_u.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXchg8U, begin, cur_);
-                    if (consume(u"rmw16_u.xchg"))
+                    }
+                    if (consume(u"rmw16_u.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXchg16U, begin, cur_);
-                    if (consume(u"rmw32_u.xchg"))
+                    }
+                    if (consume(u"rmw32_u.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXchg32U, begin, cur_);
-                    if (consume(u"rmw.xchg"))
+                    }
+                    if (consume(u"rmw.xchg")) {
                         return WasmToken(WasmToken::AtomicRMW, ThreadOp::I64AtomicXchg, begin, cur_);
-                    if (consume(u"wait"))
+                    }
+                    if (consume(u"wait")) {
                         return WasmToken(WasmToken::Wait, ThreadOp::I64Wait, begin, cur_);
+                    }
                 }
 #endif // ENABLE_WASM_THREAD_OPS
                 break;
               case 'c':
-                if (consume(u"const"))
+                if (consume(u"const")) {
                     return WasmToken(WasmToken::Const, ValType::I64, begin, cur_);
-                if (consume(u"clz"))
+                }
+                if (consume(u"clz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I64Clz, begin, cur_);
-                if (consume(u"ctz"))
+                }
+                if (consume(u"ctz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I64Ctz, begin, cur_);
+                }
                 break;
               case 'd':
-                if (consume(u"div_s"))
+                if (consume(u"div_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64DivS, begin, cur_);
-                if (consume(u"div_u"))
+                }
+                if (consume(u"div_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64DivU, begin, cur_);
+                }
                 break;
               case 'e':
-                if (consume(u"eqz"))
+                if (consume(u"eqz")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I64Eqz, begin, cur_);
-                if (consume(u"eq"))
+                }
+                if (consume(u"eq")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64Eq, begin, cur_);
-                if (consume(u"extend_s/i32"))
+                }
+                if (consume(u"extend_s/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64ExtendSI32,
                                      begin, cur_);
-                if (consume(u"extend_u/i32"))
+                }
+                if (consume(u"extend_u/i32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64ExtendUI32,
                                      begin, cur_);
-                if (consume(u"extend8_s"))
+                }
+                if (consume(u"extend8_s")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64Extend8S, begin, cur_);
-                if (consume(u"extend16_s"))
+                }
+                if (consume(u"extend16_s")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64Extend16S, begin, cur_);
-                if (consume(u"extend32_s"))
+                }
+                if (consume(u"extend32_s")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64Extend32S, begin, cur_);
+                }
                 break;
               case 'g':
-                if (consume(u"ge_s"))
+                if (consume(u"ge_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64GeS, begin, cur_);
-                if (consume(u"ge_u"))
+                }
+                if (consume(u"ge_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64GeU, begin, cur_);
-                if (consume(u"gt_s"))
+                }
+                if (consume(u"gt_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64GtS, begin, cur_);
-                if (consume(u"gt_u"))
+                }
+                if (consume(u"gt_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64GtU, begin, cur_);
+                }
                 break;
               case 'l':
-                if (consume(u"le_s"))
+                if (consume(u"le_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64LeS, begin, cur_);
-                if (consume(u"le_u"))
+                }
+                if (consume(u"le_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64LeU, begin, cur_);
-                if (consume(u"lt_s"))
+                }
+                if (consume(u"lt_s")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64LtS, begin, cur_);
-                if (consume(u"lt_u"))
+                }
+                if (consume(u"lt_u")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64LtU, begin, cur_);
+                }
                 if (consume(u"load")) {
-                    if (IsWasmSpace(*cur_))
+                    if (IsWasmSpace(*cur_)) {
                         return WasmToken(WasmToken::Load, Op::I64Load, begin, cur_);
-                    if (consume(u"8_s"))
+                    }
+                    if (consume(u"8_s")) {
                         return WasmToken(WasmToken::Load, Op::I64Load8S, begin, cur_);
-                    if (consume(u"8_u"))
+                    }
+                    if (consume(u"8_u")) {
                         return WasmToken(WasmToken::Load, Op::I64Load8U, begin, cur_);
-                    if (consume(u"16_s"))
+                    }
+                    if (consume(u"16_s")) {
                         return WasmToken(WasmToken::Load, Op::I64Load16S, begin, cur_);
-                    if (consume(u"16_u"))
+                    }
+                    if (consume(u"16_u")) {
                         return WasmToken(WasmToken::Load, Op::I64Load16U, begin, cur_);
-                    if (consume(u"32_s"))
+                    }
+                    if (consume(u"32_s")) {
                         return WasmToken(WasmToken::Load, Op::I64Load32S, begin, cur_);
-                    if (consume(u"32_u"))
+                    }
+                    if (consume(u"32_u")) {
                         return WasmToken(WasmToken::Load, Op::I64Load32U, begin, cur_);
+                    }
                     break;
                 }
                 break;
               case 'm':
-                if (consume(u"mul"))
+                if (consume(u"mul")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Mul, begin, cur_);
+                }
                 break;
               case 'n':
-                if (consume(u"ne"))
+                if (consume(u"ne")) {
                     return WasmToken(WasmToken::ComparisonOpcode, Op::I64Ne, begin, cur_);
+                }
                 break;
               case 'o':
-                if (consume(u"or"))
+                if (consume(u"or")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Or, begin, cur_);
+                }
                 break;
               case 'p':
-                if (consume(u"popcnt"))
+                if (consume(u"popcnt")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I64Popcnt, begin, cur_);
+                }
                 break;
               case 'r':
-                if (consume(u"reinterpret/f64"))
+                if (consume(u"reinterpret/f64")) {
                     return WasmToken(WasmToken::UnaryOpcode, Op::I64ReinterpretF64,
                                      begin, cur_);
-                if (consume(u"rem_s"))
+                }
+                if (consume(u"rem_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64RemS, begin, cur_);
-                if (consume(u"rem_u"))
+                }
+                if (consume(u"rem_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64RemU, begin, cur_);
-                if (consume(u"rotr"))
+                }
+                if (consume(u"rotr")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Rotr, begin, cur_);
-                if (consume(u"rotl"))
+                }
+                if (consume(u"rotl")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Rotl, begin, cur_);
+                }
                 break;
               case 's':
-                if (consume(u"sub"))
+                if (consume(u"sub")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Sub, begin, cur_);
-                if (consume(u"shl"))
+                }
+                if (consume(u"shl")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Shl, begin, cur_);
-                if (consume(u"shr_s"))
+                }
+                if (consume(u"shr_s")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64ShrS, begin, cur_);
-                if (consume(u"shr_u"))
+                }
+                if (consume(u"shr_u")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64ShrU, begin, cur_);
+                }
                 if (consume(u"store")) {
-                    if (IsWasmSpace(*cur_))
+                    if (IsWasmSpace(*cur_)) {
                         return WasmToken(WasmToken::Store, Op::I64Store, begin, cur_);
-                    if (consume(u"8"))
+                    }
+                    if (consume(u"8")) {
                         return WasmToken(WasmToken::Store, Op::I64Store8, begin, cur_);
-                    if (consume(u"16"))
+                    }
+                    if (consume(u"16")) {
                         return WasmToken(WasmToken::Store, Op::I64Store16, begin, cur_);
-                    if (consume(u"32"))
+                    }
+                    if (consume(u"32")) {
                         return WasmToken(WasmToken::Store, Op::I64Store32, begin, cur_);
+                    }
                     break;
                 }
                 break;
               case 't':
-                if (consume(u"trunc_s/f32"))
+                if (consume(u"trunc_s/f32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64TruncSF32,
                                      begin, cur_);
-                if (consume(u"trunc_s/f64"))
+                }
+                if (consume(u"trunc_s/f64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64TruncSF64,
                                      begin, cur_);
-                if (consume(u"trunc_u/f32"))
+                }
+                if (consume(u"trunc_u/f32")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64TruncUF32,
                                      begin, cur_);
-                if (consume(u"trunc_u/f64"))
+                }
+                if (consume(u"trunc_u/f64")) {
                     return WasmToken(WasmToken::ConversionOpcode, Op::I64TruncUF64,
                                      begin, cur_);
+                }
 #ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
-                if (consume(u"trunc_s:sat/f32"))
+                if (consume(u"trunc_s:sat/f32")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I64TruncSSatF32,
                                      begin, cur_);
-                if (consume(u"trunc_s:sat/f64"))
+                }
+                if (consume(u"trunc_s:sat/f64")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I64TruncSSatF64,
                                      begin, cur_);
-                if (consume(u"trunc_u:sat/f32"))
+                }
+                if (consume(u"trunc_u:sat/f32")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I64TruncUSatF32,
                                      begin, cur_);
-                if (consume(u"trunc_u:sat/f64"))
+                }
+                if (consume(u"trunc_u:sat/f64")) {
                     return WasmToken(WasmToken::ExtraConversionOpcode, MiscOp::I64TruncUSatF64,
                                      begin, cur_);
+                }
 #endif
                 break;
               case 'w':
                 break;
               case 'x':
-                if (consume(u"xor"))
+                if (consume(u"xor")) {
                     return WasmToken(WasmToken::BinaryOpcode, Op::I64Xor, begin, cur_);
+                }
                 break;
             }
             break;
         }
-        if (consume(u"import"))
+        if (consume(u"import")) {
             return WasmToken(WasmToken::Import, begin, cur_);
-        if (consume(u"infinity"))
+        }
+        if (consume(u"infinity")) {
             return WasmToken(WasmToken::Infinity, begin, cur_);
-        if (consume(u"if"))
+        }
+        if (consume(u"if")) {
             return WasmToken(WasmToken::If, begin, cur_);
+        }
         break;
 
       case 'l':
-        if (consume(u"local"))
+        if (consume(u"local")) {
             return WasmToken(WasmToken::Local, begin, cur_);
-        if (consume(u"loop"))
+        }
+        if (consume(u"loop")) {
             return WasmToken(WasmToken::Loop, begin, cur_);
+        }
         break;
 
       case 'm':
         if (consume(u"memory.")) {
 #ifdef ENABLE_WASM_BULKMEM_OPS
-            if (consume(u"copy"))
+            if (consume(u"copy")) {
                 return WasmToken(WasmToken::MemCopy, begin, cur_);
-            if (consume(u"drop"))
+            }
+            if (consume(u"drop")) {
                 return WasmToken(WasmToken::MemDrop, begin, cur_);
-            if (consume(u"fill"))
+            }
+            if (consume(u"fill")) {
                 return WasmToken(WasmToken::MemFill, begin, cur_);
-            if (consume(u"init"))
+            }
+            if (consume(u"init")) {
                 return WasmToken(WasmToken::MemInit, begin, cur_);
+            }
 #endif
-            if (consume(u"grow"))
+            if (consume(u"grow")) {
                 return WasmToken(WasmToken::GrowMemory, begin, cur_);
-            if (consume(u"size"))
+            }
+            if (consume(u"size")) {
                 return WasmToken(WasmToken::CurrentMemory, begin, cur_);
+            }
             break;
         }
-        if (consume(u"module"))
+        if (consume(u"module")) {
             return WasmToken(WasmToken::Module, begin, cur_);
-        if (consume(u"memory"))
+        }
+        if (consume(u"memory")) {
             return WasmToken(WasmToken::Memory, begin, cur_);
-        if (consume(u"mut"))
+        }
+        if (consume(u"mut")) {
             return WasmToken(WasmToken::Mutable, begin, cur_);
+        }
         break;
 
       case 'n':
-        if (consume(u"nan"))
+        if (consume(u"nan")) {
             return nan(begin);
-        if (consume(u"nop"))
+        }
+        if (consume(u"nop")) {
             return WasmToken(WasmToken::Nop, begin, cur_);
+        }
         break;
 
       case 'o':
-        if (consume(u"offset"))
+        if (consume(u"offset")) {
             return WasmToken(WasmToken::Offset, begin, cur_);
+        }
         break;
 
       case 'p':
-        if (consume(u"param"))
+        if (consume(u"param")) {
             return WasmToken(WasmToken::Param, begin, cur_);
+        }
 #ifdef ENABLE_WASM_BULKMEM_OPS
-        if (consume(u"passive"))
+        if (consume(u"passive")) {
             return WasmToken(WasmToken::Passive, begin, cur_);
+        }
 #endif
         break;
 
       case 'r':
-        if (consume(u"result"))
+        if (consume(u"result")) {
             return WasmToken(WasmToken::Result, begin, cur_);
-        if (consume(u"return"))
+        }
+        if (consume(u"return")) {
             return WasmToken(WasmToken::Return, begin, cur_);
+        }
         if (consume(u"ref")) {
-            if (consume(u".null"))
+            if (consume(u".null")) {
                 return WasmToken(WasmToken::RefNull, begin, cur_);
-            if (consume(u".is_null"))
+            }
+            if (consume(u".is_null")) {
                 return WasmToken(WasmToken::UnaryOpcode, Op::RefIsNull, begin, cur_);
+            }
             return WasmToken(WasmToken::Ref, begin, cur_);
         }
         break;
 
       case 's':
-        if (consume(u"select"))
+        if (consume(u"select")) {
             return WasmToken(WasmToken::TernaryOpcode, Op::Select, begin, cur_);
-        if (consume(u"set_global"))
+        }
+        if (consume(u"set_global")) {
             return WasmToken(WasmToken::SetGlobal, begin, cur_);
-        if (consume(u"set_local"))
+        }
+        if (consume(u"set_local")) {
             return WasmToken(WasmToken::SetLocal, begin, cur_);
+        }
 #ifdef ENABLE_WASM_THREAD_OPS
-        if (consume(u"shared"))
+        if (consume(u"shared")) {
             return WasmToken(WasmToken::Shared, begin, cur_);
+        }
 #endif
-        if (consume(u"start"))
+        if (consume(u"start")) {
             return WasmToken(WasmToken::Start, begin, cur_);
-        if (consume(u"struct"))
+        }
+        if (consume(u"struct")) {
             return WasmToken(WasmToken::Struct, begin, cur_);
+        }
         break;
 
       case 't':
 #ifdef ENABLE_WASM_BULKMEM_OPS
         if (consume(u"table.")) {
-            if (consume(u"copy"))
+            if (consume(u"copy")) {
                 return WasmToken(WasmToken::TableCopy, begin, cur_);
-            if (consume(u"drop"))
+            }
+            if (consume(u"drop")) {
                 return WasmToken(WasmToken::TableDrop, begin, cur_);
-            if (consume(u"init"))
+            }
+            if (consume(u"init")) {
                 return WasmToken(WasmToken::TableInit, begin, cur_);
+            }
             break;
         }
 #endif
-        if (consume(u"table"))
+        if (consume(u"table")) {
             return WasmToken(WasmToken::Table, begin, cur_);
-        if (consume(u"tee_local"))
+        }
+        if (consume(u"tee_local")) {
             return WasmToken(WasmToken::TeeLocal, begin, cur_);
-        if (consume(u"then"))
+        }
+        if (consume(u"then")) {
             return WasmToken(WasmToken::Then, begin, cur_);
-        if (consume(u"type"))
+        }
+        if (consume(u"type")) {
             return WasmToken(WasmToken::Type, begin, cur_);
+        }
         break;
 
       case 'u':
-        if (consume(u"unreachable"))
+        if (consume(u"unreachable")) {
             return WasmToken(WasmToken::Unreachable, begin, cur_);
+        }
         break;
 
       default:
         break;
     }
 
     return fail(begin);
 }
@@ -1833,55 +2163,61 @@ ParseExprInsideParens(WasmParseContext& 
 
 static AstExpr*
 ParseExprBody(WasmParseContext& c, WasmToken token, bool inParens);
 
 static AstExpr*
 ParseExpr(WasmParseContext& c, bool inParens)
 {
     WasmToken openParen;
-    if (!inParens || !c.ts.getIf(WasmToken::OpenParen, &openParen))
+    if (!inParens || !c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         return new(c.lifo) AstPop();
+    }
 
     // Special case: If we have an open paren, but it's a "(then ...", then
     // we don't have an expresion following us, so we pop here too. This
     // handles "(if (then ...))" which pops the condition.
     if (c.ts.peek().kind() == WasmToken::Then) {
         c.ts.unget(openParen);
         return new(c.lifo) AstPop();
     }
 
     AstExpr* expr = ParseExprInsideParens(c);
-    if (!expr)
+    if (!expr) {
         return nullptr;
-
-    if (!c.ts.match(WasmToken::CloseParen, c.error))
+    }
+
+    if (!c.ts.match(WasmToken::CloseParen, c.error)) {
         return nullptr;
+    }
 
     return expr;
 }
 
 static bool
 ParseExprList(WasmParseContext& c, AstExprVector* exprs)
 {
     for (;;) {
         if (c.ts.getIf(WasmToken::OpenParen)) {
             AstExpr* expr = ParseExprInsideParens(c);
-            if (!expr || !exprs->append(expr))
+            if (!expr || !exprs->append(expr)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
             continue;
         }
 
         WasmToken token;
         if (c.ts.getIfOpcode(&token)) {
             AstExpr* expr = ParseExprBody(c, token, false);
-            if (!expr || !exprs->append(expr))
+            if (!expr || !exprs->append(expr)) {
                 return false;
+            }
             continue;
         }
 
         break;
     }
 
     return true;
 }
@@ -1907,52 +2243,56 @@ MaybeParseValType(WasmParseContext& c, A
         }
     }
     return true;
 }
 
 static bool
 ParseValType(WasmParseContext& c, AstValType* type)
 {
-    if (!MaybeParseValType(c, type))
-        return false;
+    if (!MaybeParseValType(c, type)) {
+        return false;
+    }
 
     if (!type->isValid()) {
         c.ts.generateError(c.ts.peek(), "expected value type", c.error);
         return false;
     }
 
     return true;
 }
 
 static bool
 ParseBlockSignature(WasmParseContext& c, AstExprType* type)
 {
     WasmToken token;
     AstValType vt;
 
-    if (!MaybeParseValType(c, &vt))
-        return false;
-
-    if (vt.isValid())
+    if (!MaybeParseValType(c, &vt)) {
+        return false;
+    }
+
+    if (vt.isValid()) {
         *type = AstExprType(vt);
-    else
+    } else {
         *type = AstExprType(ExprType::Void);
+    }
 
     return true;
 }
 
 static bool
 MaybeMatchName(WasmParseContext& c, const AstName& name)
 {
     WasmToken tok;
     if (c.ts.getIf(WasmToken::Name, &tok)) {
         AstName otherName = tok.name();
-        if (otherName.empty())
+        if (otherName.empty()) {
             return true;
+        }
 
         if (name.empty()) {
             c.ts.generateError(tok, "end name without a start name", c.error);
             return false;
         }
 
         if (otherName != name) {
             c.ts.generateError(tok, "start/end names don't match", c.error);
@@ -1976,133 +2316,153 @@ ParseBlock(WasmParseContext& c, Op op, b
         AstName maybeName = c.ts.getIfName();
         if (!maybeName.empty()) {
             otherName = name;
             name = maybeName;
         }
     }
 
     AstExprType type(ExprType::Limit);
-    if (!ParseBlockSignature(c, &type))
+    if (!ParseBlockSignature(c, &type)) {
         return nullptr;
-
-    if (!ParseExprList(c, &exprs))
+    }
+
+    if (!ParseExprList(c, &exprs)) {
         return nullptr;
+    }
 
     if (!inParens) {
-        if (!c.ts.match(WasmToken::End, c.error))
+        if (!c.ts.match(WasmToken::End, c.error)) {
             return nullptr;
-        if (!MaybeMatchName(c, name))
+        }
+        if (!MaybeMatchName(c, name)) {
             return nullptr;
+        }
     }
 
     AstBlock* result = new(c.lifo) AstBlock(op, type, name, std::move(exprs));
-    if (!result)
+    if (!result) {
         return nullptr;
+    }
 
     if (op == Op::Loop && !otherName.empty()) {
-        if (!exprs.append(result))
+        if (!exprs.append(result)) {
             return nullptr;
+        }
         result = new(c.lifo) AstBlock(Op::Block, type, otherName, std::move(exprs));
     }
 
     return result;
 }
 
 static AstBranch*
 ParseBranch(WasmParseContext& c, Op op, bool inParens)
 {
     MOZ_ASSERT(op == Op::Br || op == Op::BrIf);
 
     AstRef target;
-    if (!c.ts.matchRef(&target, c.error))
+    if (!c.ts.matchRef(&target, c.error)) {
         return nullptr;
+    }
 
     AstExpr* value = nullptr;
     if (inParens) {
         if (c.ts.getIf(WasmToken::OpenParen)) {
             value = ParseExprInsideParens(c);
-            if (!value)
+            if (!value) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
         }
     }
 
     AstExpr* cond = nullptr;
     if (op == Op::BrIf) {
         if (inParens && c.ts.getIf(WasmToken::OpenParen)) {
             cond = ParseExprInsideParens(c);
-            if (!cond)
+            if (!cond) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
         } else {
             cond = new(c.lifo) AstPop();
-            if (!cond)
+            if (!cond) {
                 return nullptr;
+            }
         }
     }
 
     return new(c.lifo) AstBranch(op, ExprType::Void, cond, target, value);
 }
 
 static bool
 ParseArgs(WasmParseContext& c, AstExprVector* args)
 {
     while (c.ts.getIf(WasmToken::OpenParen)) {
         AstExpr* arg = ParseExprInsideParens(c);
-        if (!arg || !args->append(arg))
+        if (!arg || !args->append(arg)) {
             return false;
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static AstCall*
 ParseCall(WasmParseContext& c, bool inParens)
 {
     AstRef func;
-    if (!c.ts.matchRef(&func, c.error))
+    if (!c.ts.matchRef(&func, c.error)) {
         return nullptr;
+    }
 
     AstExprVector args(c.lifo);
     if (inParens) {
-        if (!ParseArgs(c, &args))
+        if (!ParseArgs(c, &args)) {
             return nullptr;
+        }
     }
 
     return new(c.lifo) AstCall(Op::Call, ExprType::Void, func, std::move(args));
 }
 
 static AstCallIndirect*
 ParseCallIndirect(WasmParseContext& c, bool inParens)
 {
     AstRef funcType;
-    if (!c.ts.matchRef(&funcType, c.error))
+    if (!c.ts.matchRef(&funcType, c.error)) {
         return nullptr;
+    }
 
     AstExprVector args(c.lifo);
     AstExpr* index;
     if (inParens) {
-        if (!ParseArgs(c, &args))
+        if (!ParseArgs(c, &args)) {
             return nullptr;
-
-        if (args.empty())
+        }
+
+        if (args.empty()) {
             index = new(c.lifo) AstPop();
-        else
+        } else {
             index = args.popCopy();
+        }
     } else {
         index = new(c.lifo) AstPop();
     }
 
-    if (!index)
+    if (!index) {
         return nullptr;
+    }
 
     return new(c.lifo) AstCallIndirect(funcType, ExprType::Void, std::move(args), index);
 }
 
 static uint_fast8_t
 CountLeadingZeroes4(uint8_t x)
 {
     MOZ_ASSERT((x & -0x10) == 0);
@@ -2132,34 +2492,38 @@ ParseNaNLiteral(WasmParseContext& c, Was
     MOZ_ALWAYS_TRUE(*cur++ == 'n' && *cur++ == 'a' && *cur++ == 'n');
 
     typedef FloatingPoint<Float> Traits;
     typedef typename Traits::Bits Bits;
 
     Bits value;
     if (cur != end) {
         MOZ_ALWAYS_TRUE(*cur++ == ':' && *cur++ == '0' && *cur++ == 'x');
-        if (cur == end)
+        if (cur == end) {
             goto error;
+        }
         CheckedInt<Bits> u = 0;
         do {
             uint8_t digit = 0;
             MOZ_ALWAYS_TRUE(IsHexDigit(*cur, &digit));
             u *= 16;
             u += digit;
             cur++;
         } while (cur != end);
-        if (!u.isValid())
+        if (!u.isValid()) {
             goto error;
+        }
         value = u.value();
-        if ((value & ~Traits::kSignificandBits) != 0)
+        if ((value & ~Traits::kSignificandBits) != 0) {
             goto error;
+        }
         // NaN payloads must contain at least one set bit.
-        if (value == 0)
+        if (value == 0) {
             goto error;
+        }
     } else {
         // Produce the spec's default NaN.
         value = (Traits::kSignificandBits + 1) >> 1;
     }
 
     value = (isNegated ? Traits::kSignBit : 0) | Traits::kExponentBits | value;
 
     Float flt;
@@ -2192,42 +2556,47 @@ ParseHexFloatLiteral(const char16_t* cur
     for (; cur != end; cur++) {
         if (*cur == '.') {
             MOZ_ASSERT(!dot);
             dot = cur;
             continue;
         }
 
         uint8_t digit;
-        if (!IsHexDigit(*cur, &digit))
+        if (!IsHexDigit(*cur, &digit)) {
             break;
+        }
         if (!sawFirstNonZero) {
-            if (digit == 0)
+            if (digit == 0) {
                 continue;
+            }
             // We've located the first non-zero digit; we can now determine the
             // initial exponent. If we're after the dot, count the number of
             // zeros from the dot to here, and adjust for the number of leading
             // zero bits in the digit. Set up significandPos to put the first
             // nonzero at the most significant bit.
             int_fast8_t lz = CountLeadingZeroes4(digit);
             ptrdiff_t zeroAdjustValue = !dot ? 1 : dot + 1 - cur;
             CheckedInt<ptrdiff_t> zeroAdjust = zeroAdjustValue;
             zeroAdjust *= 4;
             zeroAdjust -= lz + 1;
-            if (!zeroAdjust.isValid())
+            if (!zeroAdjust.isValid()) {
                 return false;
+            }
             exponent = zeroAdjust.value();
             significandPos = numBits - (4 - lz);
             sawFirstNonZero = true;
         } else {
             // We've already seen a non-zero; just take 4 more bits.
-            if (!dot)
+            if (!dot) {
                 exponent += 4;
-            if (significandPos > -4)
+            }
+            if (significandPos > -4) {
                 significandPos -= 4;
+            }
         }
 
         // Or the newly parsed digit into significand at signicandPos.
         if (significandPos >= 0) {
             significand |= ushl(Bits(digit), significandPos);
         } else if (significandPos > -4) {
             significand |= ushr(digit, 4 - significandPos);
             discardedExtraNonZero = (digit & ~ushl(allOnes, 4 - significandPos)) != 0;
@@ -2235,29 +2604,33 @@ ParseHexFloatLiteral(const char16_t* cur
             discardedExtraNonZero = true;
         }
     }
 
     // Exponent part.
     if (cur != end) {
         MOZ_ALWAYS_TRUE(*cur++ == 'p');
         bool isNegated = false;
-        if (cur != end && (*cur == '-' || *cur == '+'))
+        if (cur != end && (*cur == '-' || *cur == '+')) {
             isNegated = *cur++ == '-';
+        }
         CheckedInt<int32_t> parsedExponent = 0;
-        while (cur != end && IsWasmDigit(*cur))
+        while (cur != end && IsWasmDigit(*cur)) {
             parsedExponent = parsedExponent * 10 + (*cur++ - '0');
-        if (isNegated)
+        }
+        if (isNegated) {
             parsedExponent = -parsedExponent;
+        }
         exponent += parsedExponent;
     }
 
     MOZ_ASSERT(cur == end);
-    if (!exponent.isValid())
-        return false;
+    if (!exponent.isValid()) {
+        return false;
+    }
 
     // Create preliminary exponent and significand encodings of the results.
     Bits encodedExponent, encodedSignificand, discardedSignificandBits;
     if (significand == 0) {
         // Zero. The exponent is encoded non-biased.
         encodedExponent = 0;
         encodedSignificand = 0;
         discardedSignificandBits = 0;
@@ -2310,26 +2683,28 @@ ParseFloatLiteral(WasmParseContext& c, W
       case WasmToken::Index:           result = token.index(); break;
       case WasmToken::UnsignedInteger: result = token.uint(); break;
       case WasmToken::SignedInteger:   result = token.sint(); break;
       case WasmToken::NegativeZero:    result = -0.; break;
       case WasmToken::Float:           break;
       default:                         c.ts.generateError(token, c.error); return nullptr;
     }
 
-    if (token.kind() != WasmToken::Float)
+    if (token.kind() != WasmToken::Float) {
         return new (c.lifo) AstConst(LitVal(Float(result)));
+    }
 
     const char16_t* begin = token.begin();
     const char16_t* end = token.end();
     const char16_t* cur = begin;
 
     bool isNegated = false;
-    if (*cur == '-' || *cur == '+')
+    if (*cur == '-' || *cur == '+') {
         isNegated = *cur++ == '-';
+    }
 
     switch (token.floatLiteralKind()) {
       case WasmToken::Infinity: {
         result = PositiveInfinity<Float>();
         break;
       }
       case WasmToken::NaN: {
         return ParseNaNLiteral<Float>(c, token, cur, isNegated);
@@ -2341,52 +2716,56 @@ ParseFloatLiteral(WasmParseContext& c, W
         }
         break;
       }
       case WasmToken::DecNumber: {
         // Call into JS' strtod. Tokenization has already required that the
         // string is well-behaved.
         LifoAlloc::Mark mark = c.lifo.mark();
         char* buffer = c.lifo.newArray<char>(end - cur + 1);
-        if (!buffer)
+        if (!buffer) {
             return nullptr;
-        for (ptrdiff_t i = 0; i < end - cur; ++i)
+        }
+        for (ptrdiff_t i = 0; i < end - cur; ++i) {
             buffer[i] = char(cur[i]);
+        }
         buffer[end - cur] = '\0';
         char* strtod_end;
         result = (Float)js_strtod_harder(c.dtoaState, buffer, &strtod_end);
         if (strtod_end == buffer) {
             c.lifo.release(mark);
             c.ts.generateError(token, c.error);
             return nullptr;
         }
         c.lifo.release(mark);
         break;
       }
     }
 
-    if (isNegated)
+    if (isNegated) {
         result = -result;
+    }
 
     return new (c.lifo) AstConst(LitVal(Float(result)));
 }
 
 static AstConst*
 ParseConst(WasmParseContext& c, WasmToken constToken)
 {
     WasmToken val = c.ts.get();
     switch (constToken.valueType().code()) {
       case ValType::I32: {
         switch (val.kind()) {
           case WasmToken::Index:
             return new(c.lifo) AstConst(LitVal(val.index()));
           case WasmToken::SignedInteger: {
             CheckedInt<int32_t> sint = val.sint();
-            if (!sint.isValid())
+            if (!sint.isValid()) {
                 break;
+            }
             return new(c.lifo) AstConst(LitVal(uint32_t(sint.value())));
           }
           case WasmToken::NegativeZero:
             return new(c.lifo) AstConst(LitVal(uint32_t(0)));
           default:
             break;
         }
         break;
@@ -2418,286 +2797,322 @@ ParseConst(WasmParseContext& c, WasmToke
     c.ts.generateError(constToken, c.error);
     return nullptr;
 }
 
 static AstGetLocal*
 ParseGetLocal(WasmParseContext& c)
 {
     AstRef local;
-    if (!c.ts.matchRef(&local, c.error))
+    if (!c.ts.matchRef(&local, c.error)) {
         return nullptr;
+    }
 
     return new(c.lifo) AstGetLocal(local);
 }
 
 static AstGetGlobal*
 ParseGetGlobal(WasmParseContext& c)
 {
     AstRef local;
-    if (!c.ts.matchRef(&local, c.error))
+    if (!c.ts.matchRef(&local, c.error)) {
         return nullptr;
+    }
     return new(c.lifo) AstGetGlobal(local);
 }
 
 static AstSetGlobal*
 ParseSetGlobal(WasmParseContext& c, bool inParens)
 {
     AstRef global;
-    if (!c.ts.matchRef(&global, c.error))
+    if (!c.ts.matchRef(&global, c.error)) {
         return nullptr;
+    }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     return new(c.lifo) AstSetGlobal(global, *value);
 }
 
 static AstSetLocal*
 ParseSetLocal(WasmParseContext& c, bool inParens)
 {
     AstRef local;
-    if (!c.ts.matchRef(&local, c.error))
+    if (!c.ts.matchRef(&local, c.error)) {
         return nullptr;
+    }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     return new(c.lifo) AstSetLocal(local, *value);
 }
 
 static AstTeeLocal*
 ParseTeeLocal(WasmParseContext& c, bool inParens)
 {
     AstRef local;
-    if (!c.ts.matchRef(&local, c.error))
+    if (!c.ts.matchRef(&local, c.error)) {
         return nullptr;
+    }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     return new(c.lifo) AstTeeLocal(local, *value);
 }
 
 static AstReturn*
 ParseReturn(WasmParseContext& c, bool inParens)
 {
     AstExpr* maybeExpr = nullptr;
 
     if (c.ts.peek().kind() != WasmToken::CloseParen) {
         maybeExpr = ParseExpr(c, inParens);
-        if (!maybeExpr)
+        if (!maybeExpr) {
             return nullptr;
+        }
     }
 
     return new(c.lifo) AstReturn(maybeExpr);
 }
 
 static AstUnaryOperator*
 ParseUnaryOperator(WasmParseContext& c, Op op, bool inParens)
 {
     AstExpr* operand = ParseExpr(c, inParens);
-    if (!operand)
+    if (!operand) {
         return nullptr;
+    }
 
     return new(c.lifo) AstUnaryOperator(op, operand);
 }
 
 static AstBinaryOperator*
 ParseBinaryOperator(WasmParseContext& c, Op op, bool inParens)
 {
     AstExpr* lhs = ParseExpr(c, inParens);
-    if (!lhs)
+    if (!lhs) {
         return nullptr;
+    }
 
     AstExpr* rhs = ParseExpr(c, inParens);
-    if (!rhs)
+    if (!rhs) {
         return nullptr;
+    }
 
     return new(c.lifo) AstBinaryOperator(op, lhs, rhs);
 }
 
 static AstComparisonOperator*
 ParseComparisonOperator(WasmParseContext& c, Op op, bool inParens)
 {
     AstExpr* lhs = ParseExpr(c, inParens);
-    if (!lhs)
+    if (!lhs) {
         return nullptr;
+    }
 
     AstExpr* rhs = ParseExpr(c, inParens);
-    if (!rhs)
+    if (!rhs) {
         return nullptr;
+    }
 
     return new(c.lifo) AstComparisonOperator(op, lhs, rhs);
 }
 
 static AstTernaryOperator*
 ParseTernaryOperator(WasmParseContext& c, Op op, bool inParens)
 {
     AstExpr* op0 = ParseExpr(c, inParens);
-    if (!op0)
+    if (!op0) {
         return nullptr;
+    }
 
     AstExpr* op1 = ParseExpr(c, inParens);
-    if (!op1)
+    if (!op1) {
         return nullptr;
+    }
 
     AstExpr* op2 = ParseExpr(c, inParens);
-    if (!op2)
+    if (!op2) {
         return nullptr;
+    }
 
     return new(c.lifo) AstTernaryOperator(op, op0, op1, op2);
 }
 
 static AstConversionOperator*
 ParseConversionOperator(WasmParseContext& c, Op op, bool inParens)
 {
     AstExpr* operand = ParseExpr(c, inParens);
-    if (!operand)
+    if (!operand) {
         return nullptr;
+    }
 
     return new(c.lifo) AstConversionOperator(op, operand);
 }
 
 #ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
 static AstExtraConversionOperator*
 ParseExtraConversionOperator(WasmParseContext& c, MiscOp op, bool inParens)
 {
     AstExpr* operand = ParseExpr(c, inParens);
-    if (!operand)
+    if (!operand) {
         return nullptr;
+    }
 
     return new(c.lifo) AstExtraConversionOperator(op, operand);
 }
 #endif
 
 static AstDrop*
 ParseDrop(WasmParseContext& c, bool inParens)
 {
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     return new(c.lifo) AstDrop(*value);
 }
 
 static AstIf*
 ParseIf(WasmParseContext& c, bool inParens)
 {
     AstName name = c.ts.getIfName();
 
     AstExprType type(ExprType::Limit);
-    if (!ParseBlockSignature(c, &type))
+    if (!ParseBlockSignature(c, &type)) {
         return nullptr;
+    }
 
     AstExpr* cond = ParseExpr(c, inParens);
-    if (!cond)
+    if (!cond) {
         return nullptr;
+    }
 
     if (inParens) {
-        if (!c.ts.match(WasmToken::OpenParen, c.error))
+        if (!c.ts.match(WasmToken::OpenParen, c.error)) {
             return nullptr;
+        }
     }
 
     AstExprVector thenExprs(c.lifo);
     if (!inParens || c.ts.getIf(WasmToken::Then)) {
-        if (!ParseExprList(c, &thenExprs))
+        if (!ParseExprList(c, &thenExprs)) {
             return nullptr;
+        }
     } else {
         AstExpr* thenBranch = ParseExprInsideParens(c);
-        if (!thenBranch || !thenExprs.append(thenBranch))
+        if (!thenBranch || !thenExprs.append(thenBranch)) {
             return nullptr;
+        }
     }
     if (inParens) {
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return nullptr;
+        }
     }
 
     AstExprVector elseExprs(c.lifo);
     if (!inParens || c.ts.getIf(WasmToken::OpenParen)) {
         if (c.ts.getIf(WasmToken::Else)) {
-            if (!MaybeMatchName(c, name))
+            if (!MaybeMatchName(c, name)) {
                 return nullptr;
-            if (!ParseExprList(c, &elseExprs))
+            }
+            if (!ParseExprList(c, &elseExprs)) {
                 return nullptr;
+            }
         } else if (inParens) {
             AstExpr* elseBranch = ParseExprInsideParens(c);
-            if (!elseBranch || !elseExprs.append(elseBranch))
+            if (!elseBranch || !elseExprs.append(elseBranch)) {
                 return nullptr;
+            }
         }
         if (inParens) {
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
         } else {
-            if (!c.ts.match(WasmToken::End, c.error))
+            if (!c.ts.match(WasmToken::End, c.error)) {
                 return nullptr;
-            if (!MaybeMatchName(c, name))
+            }
+            if (!MaybeMatchName(c, name)) {
                 return nullptr;
+            }
         }
     }
 
     return new(c.lifo) AstIf(type, cond, name, std::move(thenExprs), std::move(elseExprs));
 }
 
 static bool
 ParseLoadStoreAddress(WasmParseContext& c, int32_t* offset, uint32_t* alignLog2, AstExpr** base,
                       bool inParens)
 {
     *offset = 0;
     if (c.ts.getIf(WasmToken::Offset)) {
-        if (!c.ts.match(WasmToken::Equal, c.error))
+        if (!c.ts.match(WasmToken::Equal, c.error)) {
             return false;
+        }
         WasmToken val = c.ts.get();
         switch (val.kind()) {
           case WasmToken::Index:
             *offset = val.index();
             break;
           default:
             c.ts.generateError(val, c.error);
             return false;
         }
     }
 
     *alignLog2 = UINT32_MAX;
     if (c.ts.getIf(WasmToken::Align)) {
-        if (!c.ts.match(WasmToken::Equal, c.error))
+        if (!c.ts.match(WasmToken::Equal, c.error)) {
             return false;
+        }
         WasmToken val = c.ts.get();
         switch (val.kind()) {
           case WasmToken::Index:
             if (!IsPowerOfTwo(val.index())) {
                 c.ts.generateError(val, "non-power-of-two alignment", c.error);
                 return false;
             }
             *alignLog2 = CeilingLog2(val.index());
             break;
           default:
             c.ts.generateError(val, c.error);
             return false;
         }
     }
 
     *base = ParseExpr(c, inParens);
-    if (!*base)
-        return false;
+    if (!*base) {
+        return false;
+    }
 
     return true;
 }
 
 static AstLoad*
 ParseLoad(WasmParseContext& c, Op op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case Op::I32Load8S:
           case Op::I32Load8U:
           case Op::I64Load8S:
           case Op::I64Load8U:
             alignLog2 = 0;
@@ -2729,18 +3144,19 @@ ParseLoad(WasmParseContext& c, Op op, bo
 }
 
 static AstStore*
 ParseStore(WasmParseContext& c, Op op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case Op::I32Store8:
           case Op::I64Store8:
             alignLog2 = 0;
             break;
           case Op::I32Store16:
@@ -2757,32 +3173,34 @@ ParseStore(WasmParseContext& c, Op op, b
             alignLog2 = 3;
             break;
           default:
             MOZ_CRASH("Bad load op");
         }
     }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstStore(op, AstLoadStoreAddress(base, flags, offset), value);
 }
 
 static AstAtomicCmpXchg*
 ParseAtomicCmpXchg(WasmParseContext& c, ThreadOp op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case ThreadOp::I32AtomicCmpXchg8U:
           case ThreadOp::I64AtomicCmpXchg8U:
             alignLog2 = 0;
             break;
           case ThreadOp::I32AtomicCmpXchg16U:
@@ -2797,37 +3215,40 @@ ParseAtomicCmpXchg(WasmParseContext& c, 
             alignLog2 = 3;
             break;
           default:
             MOZ_CRASH("Bad cmpxchg op");
         }
     }
 
     AstExpr* expected = ParseExpr(c, inParens);
-    if (!expected)
+    if (!expected) {
         return nullptr;
+    }
 
     AstExpr* replacement = ParseExpr(c, inParens);
-    if (!replacement)
+    if (!replacement) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstAtomicCmpXchg(op, AstLoadStoreAddress(base, flags, offset), expected,
                                         replacement);
 }
 
 static AstAtomicLoad*
 ParseAtomicLoad(WasmParseContext& c, ThreadOp op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case ThreadOp::I32AtomicLoad8U:
           case ThreadOp::I64AtomicLoad8U:
             alignLog2 = 0;
             break;
           case ThreadOp::I32AtomicLoad16U:
@@ -2852,18 +3273,19 @@ ParseAtomicLoad(WasmParseContext& c, Thr
 }
 
 static AstAtomicRMW*
 ParseAtomicRMW(WasmParseContext& c, ThreadOp op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case ThreadOp::I32AtomicAdd8U:
           case ThreadOp::I64AtomicAdd8U:
           case ThreadOp::I32AtomicAnd8U:
           case ThreadOp::I64AtomicAnd8U:
           case ThreadOp::I32AtomicOr8U:
@@ -2913,32 +3335,34 @@ ParseAtomicRMW(WasmParseContext& c, Thre
             alignLog2 = 3;
             break;
           default:
             MOZ_CRASH("Bad RMW op");
         }
     }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstAtomicRMW(op, AstLoadStoreAddress(base, flags, offset), value);
 }
 
 static AstAtomicStore*
 ParseAtomicStore(WasmParseContext& c, ThreadOp op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case ThreadOp::I32AtomicStore8U:
           case ThreadOp::I64AtomicStore8U:
             alignLog2 = 0;
             break;
           case ThreadOp::I32AtomicStore16U:
@@ -2953,144 +3377,159 @@ ParseAtomicStore(WasmParseContext& c, Th
             alignLog2 = 3;
             break;
           default:
             MOZ_CRASH("Bad store op");
         }
     }
 
     AstExpr* value = ParseExpr(c, inParens);
-    if (!value)
+    if (!value) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstAtomicStore(op, AstLoadStoreAddress(base, flags, offset), value);
 }
 
 static AstWait*
 ParseWait(WasmParseContext& c, ThreadOp op, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     if (alignLog2 == UINT32_MAX) {
         switch (op) {
           case ThreadOp::I32Wait:
             alignLog2 = 2;
             break;
           case ThreadOp::I64Wait:
             alignLog2 = 3;
             break;
           default:
             MOZ_CRASH("Bad wait op");
         }
     }
 
     AstExpr* expected = ParseExpr(c, inParens);
-    if (!expected)
+    if (!expected) {
         return nullptr;
+    }
 
     AstExpr* timeout = ParseExpr(c, inParens);
-    if (!timeout)
+    if (!timeout) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstWait(op, AstLoadStoreAddress(base, flags, offset), expected, timeout);
 }
 
 static AstWake*
 ParseWake(WasmParseContext& c, bool inParens)
 {
     int32_t offset;
     uint32_t alignLog2;
     AstExpr* base;
-    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens))
+    if (!ParseLoadStoreAddress(c, &offset, &alignLog2, &base, inParens)) {
         return nullptr;
+    }
 
     // Per spec, the required (and default) alignment is 4, because the smallest
     // access is int32.
-    if (alignLog2 == UINT32_MAX)
+    if (alignLog2 == UINT32_MAX) {
         alignLog2 = 2;
+    }
 
     AstExpr* count = ParseExpr(c, inParens);
-    if (!count)
+    if (!count) {
         return nullptr;
+    }
 
     uint32_t flags = alignLog2;
 
     return new(c.lifo) AstWake(AstLoadStoreAddress(base, flags, offset), count);
 }
 
 static AstBranchTable*
 ParseBranchTable(WasmParseContext& c, bool inParens)
 {
     AstRefVector table(c.lifo);
 
     AstRef target;
     while (c.ts.getIfRef(&target)) {
-        if (!table.append(target))
+        if (!table.append(target)) {
             return nullptr;
+        }
     }
 
     if (table.empty()) {
         c.ts.generateError(c.ts.get(), c.error);
         return nullptr;
     }
 
     AstRef def = table.popCopy();
 
     AstExpr* index = ParseExpr(c, inParens);
-    if (!index)
+    if (!index) {
         return nullptr;
+    }
 
     AstExpr* value = nullptr;
     if (inParens) {
         if (c.ts.getIf(WasmToken::OpenParen)) {
             value = index;
             index = ParseExprInsideParens(c);
-            if (!index)
+            if (!index) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
         }
     }
 
     return new(c.lifo) AstBranchTable(*index, def, std::move(table), value);
 }
 
 static AstGrowMemory*
 ParseGrowMemory(WasmParseContext& c, bool inParens)
 {
     AstExpr* operand = ParseExpr(c, inParens);
-    if (!operand)
+    if (!operand) {
         return nullptr;
+    }
 
     return new(c.lifo) AstGrowMemory(operand);
 }
 
 #ifdef ENABLE_WASM_BULKMEM_OPS
 static AstMemOrTableCopy*
 ParseMemOrTableCopy(WasmParseContext& c, bool inParens, bool isMem)
 {
     AstExpr* dest = ParseExpr(c, inParens);
-    if (!dest)
+    if (!dest) {
         return nullptr;
+    }
 
     AstExpr* src = ParseExpr(c, inParens);
-    if (!src)
+    if (!src) {
         return nullptr;
+    }
 
     AstExpr* len = ParseExpr(c, inParens);
-    if (!len)
+    if (!len) {
         return nullptr;
+    }
 
     return new(c.lifo) AstMemOrTableCopy(isMem, dest, src, len);
 }
 
 static AstMemOrTableDrop*
 ParseMemOrTableDrop(WasmParseContext& c, bool isMem)
 {
     WasmToken segIndexTok;
@@ -3099,26 +3538,29 @@ ParseMemOrTableDrop(WasmParseContext& c,
 
     return new(c.lifo) AstMemOrTableDrop(isMem, segIndexTok.index());
 }
 
 static AstMemFill*
 ParseMemFill(WasmParseContext& c, bool inParens)
 {
     AstExpr* start = ParseExpr(c, inParens);
-    if (!start)
+    if (!start) {
         return nullptr;
+    }
 
     AstExpr* val = ParseExpr(c, inParens);
-    if (!val)
+    if (!val) {
         return nullptr;
+    }
 
     AstExpr* len = ParseExpr(c, inParens);
-    if (!len)
+    if (!len) {
         return nullptr;
+    }
 
     return new(c.lifo) AstMemFill(start, val, len);
 }
 
 static AstMemOrTableInit*
 ParseMemOrTableInit(WasmParseContext& c, bool inParens, bool isMem)
 {
     WasmToken segIndexTok;
@@ -3142,32 +3584,34 @@ ParseMemOrTableInit(WasmParseContext& c,
 #endif
 
 static AstExpr*
 ParseRefNull(WasmParseContext& c)
 {
     WasmToken token;
     AstValType vt;
 
-    if (!ParseValType(c, &vt))
+    if (!ParseValType(c, &vt)) {
         return nullptr;
+    }
 
     if (!vt.isRefType()) {
         c.ts.generateError(token, "ref.null requires ref type", c.error);
         return nullptr;
     }
 
     return new(c.lifo) AstRefNull(vt);
 }
 
 static AstExpr*
 ParseExprBody(WasmParseContext& c, WasmToken token, bool inParens)
 {
-    if (!CheckRecursionLimitDontReport(c.stackLimit))
+    if (!CheckRecursionLimitDontReport(c.stackLimit)) {
         return nullptr;
+    }
     switch (token.kind()) {
       case WasmToken::Unreachable:
         return new(c.lifo) AstUnreachable;
       case WasmToken::AtomicCmpXchg:
         return ParseAtomicCmpXchg(c, token.threadOp(), inParens);
       case WasmToken::AtomicLoad:
         return ParseAtomicLoad(c, token.threadOp(), inParens);
       case WasmToken::AtomicRMW:
@@ -3266,47 +3710,52 @@ ParseExprInsideParens(WasmParseContext& 
     return ParseExprBody(c, token, true);
 }
 
 static bool
 ParseValueTypeList(WasmParseContext& c, AstValTypeVector* vec)
 {
     for (;;) {
         AstValType vt;
-        if (!MaybeParseValType(c, &vt))
+        if (!MaybeParseValType(c, &vt)) {
             return false;
-        if (!vt.isValid())
+        }
+        if (!vt.isValid()) {
             break;
-        if (!vec->append(vt))
+        }
+        if (!vec->append(vt)) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 ParseResult(WasmParseContext& c, AstExprType* result)
 {
     if (!result->isVoid()) {
         c.ts.generateError(c.ts.peek(), c.error);
         return false;
     }
 
     AstValType type;
-    if (!ParseValType(c, &type))
-        return false;
+    if (!ParseValType(c, &type)) {
+        return false;
+    }
 
     *result = AstExprType(type);
     return true;
 }
 
 static bool
 ParseLocalOrParam(WasmParseContext& c, AstNameVector* locals, AstValTypeVector* localTypes)
 {
-    if (c.ts.peek().kind() != WasmToken::Name)
+    if (c.ts.peek().kind() != WasmToken::Name) {
         return locals->append(AstName()) && ParseValueTypeList(c, localTypes);
+    }
 
     AstValType type;
     return locals->append(c.ts.get().name()) &&
            ParseValType(c, &type) &&
            localTypes->append(type);
 }
 
 static bool
@@ -3315,33 +3764,36 @@ ParseInlineImport(WasmParseContext& c, I
     return c.ts.match(WasmToken::Text, &import->module, c.error) &&
            c.ts.match(WasmToken::Text, &import->field, c.error);
 }
 
 static bool
 ParseInlineExport(WasmParseContext& c, DefinitionKind kind, AstModule* module, AstRef ref)
 {
     WasmToken name;
-    if (!c.ts.match(WasmToken::Text, &name, c.error))
-        return false;
+    if (!c.ts.match(WasmToken::Text, &name, c.error)) {
+        return false;
+    }
 
     AstExport* exp = new(c.lifo) AstExport(name.text(), kind, ref);
     return exp && module->append(exp);
 }
 
 static bool
 MaybeParseTypeUse(WasmParseContext& c, AstRef* funcType)
 {
     WasmToken openParen;
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Type)) {
-            if (!c.ts.matchRef(funcType, c.error))
+            if (!c.ts.matchRef(funcType, c.error)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
         } else {
             c.ts.unget(openParen);
         }
     }
     return true;
 }
 
 static bool
@@ -3349,48 +3801,54 @@ ParseFuncSig(WasmParseContext& c, AstFun
 {
     AstValTypeVector args(c.lifo);
     AstExprType result = AstExprType(ExprType::Void);
 
     while (c.ts.getIf(WasmToken::OpenParen)) {
         WasmToken token = c.ts.get();
         switch (token.kind()) {
           case WasmToken::Param:
-            if (!ParseValueTypeList(c, &args))
+            if (!ParseValueTypeList(c, &args)) {
                 return false;
+            }
             break;
           case WasmToken::Result:
-            if (!ParseResult(c, &result))
+            if (!ParseResult(c, &result)) {
                 return false;
+            }
             break;
           default:
             c.ts.generateError(token, c.error);
             return false;
         }
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
+        }
     }
 
     *funcType = AstFuncType(std::move(args), result);
     return true;
 }
 
 static bool
 ParseFuncType(WasmParseContext& c, AstRef* ref, AstModule* module)
 {
-    if (!MaybeParseTypeUse(c, ref))
-        return false;
+    if (!MaybeParseTypeUse(c, ref)) {
+        return false;
+    }
 
     if (ref->isInvalid()) {
         AstFuncType funcType(c.lifo);
-        if (!ParseFuncSig(c, &funcType))
+        if (!ParseFuncSig(c, &funcType)) {
             return false;
+        }
         uint32_t funcTypeIndex;
-        if (!module->declare(std::move(funcType), &funcTypeIndex))
+        if (!module->declare(std::move(funcType), &funcTypeIndex)) {
             return false;
+        }
         ref->setIndex(funcTypeIndex);
     }
 
     return true;
 }
 
 static bool
 ParseFunc(WasmParseContext& c, AstModule* module)
@@ -3406,86 +3864,99 @@ ParseFunc(WasmParseContext& c, AstModule
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Import)) {
             if (module->funcs().length()) {
                 c.ts.generateError(openParen, "import after function definition", c.error);
                 return false;
             }
 
             InlineImport names;
-            if (!ParseInlineImport(c, &names))
+            if (!ParseInlineImport(c, &names)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
 
             AstRef funcType;
-            if (!ParseFuncType(c, &funcType, module))
+            if (!ParseFuncType(c, &funcType, module)) {
                 return false;
+            }
 
             auto* imp = new(c.lifo) AstImport(funcName, names.module.text(), names.field.text(), funcType);
             return imp && module->append(imp);
         }
 
         if (c.ts.getIf(WasmToken::Export)) {
             AstRef ref = funcName.empty()
                          ? AstRef(module->numFuncImports() + module->funcs().length())
                          : AstRef(funcName);
-            if (!ParseInlineExport(c, DefinitionKind::Function, module, ref))
+            if (!ParseInlineExport(c, DefinitionKind::Function, module, ref)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
         } else {
             c.ts.unget(openParen);
         }
     }
 
     AstRef funcTypeRef;
-    if (!MaybeParseTypeUse(c, &funcTypeRef))
-        return false;
+    if (!MaybeParseTypeUse(c, &funcTypeRef)) {
+        return false;
+    }
 
     AstExprVector body(c.lifo);
 
     AstExprType result = AstExprType(ExprType::Void);
     while (c.ts.getIf(WasmToken::OpenParen)) {
         WasmToken token = c.ts.get();
         switch (token.kind()) {
           case WasmToken::Local:
-            if (!ParseLocalOrParam(c, &locals, &vars))
+            if (!ParseLocalOrParam(c, &locals, &vars)) {
                 return false;
+            }
             break;
           case WasmToken::Param:
             if (!vars.empty()) {
                 c.ts.generateError(token, c.error);
                 return false;
             }
-            if (!ParseLocalOrParam(c, &locals, &args))
+            if (!ParseLocalOrParam(c, &locals, &args)) {
                 return false;
+            }
             break;
           case WasmToken::Result:
-            if (!ParseResult(c, &result))
+            if (!ParseResult(c, &result)) {
                 return false;
+            }
             break;
           default:
             c.ts.unget(token);
             AstExpr* expr = ParseExprInsideParens(c);
-            if (!expr || !body.append(expr))
+            if (!expr || !body.append(expr)) {
                 return false;
+            }
             break;
         }
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
-    }
-
-    if (!ParseExprList(c, &body))
-        return false;
+        }
+    }
+
+    if (!ParseExprList(c, &body)) {
+        return false;
+    }
 
     if (funcTypeRef.isInvalid()) {
         uint32_t funcTypeIndex;
-        if (!module->declare(AstFuncType(std::move(args), result), &funcTypeIndex))
+        if (!module->declare(AstFuncType(std::move(args), result), &funcTypeIndex)) {
             return false;
+        }
         funcTypeRef.setIndex(funcTypeIndex);
     }
 
     auto* func = new(c.lifo) AstFunc(funcName, funcTypeRef, std::move(vars), std::move(locals), std::move(body));
     return func && module->append(func);
 }
 
 static bool
@@ -3494,71 +3965,82 @@ ParseGlobalType(WasmParseContext& c, Ast
 static bool
 ParseStructFields(WasmParseContext& c, AstStructType* st)
 {
     AstNameVector    names(c.lifo);
     AstBoolVector    mutability(c.lifo);
     AstValTypeVector types(c.lifo);
 
     while (true) {
-        if (!c.ts.getIf(WasmToken::OpenParen))
+        if (!c.ts.getIf(WasmToken::OpenParen)) {
             break;
-
-        if (!c.ts.match(WasmToken::Field, c.error))
+        }
+
+        if (!c.ts.match(WasmToken::Field, c.error)) {
             return false;
+        }
 
         AstName name = c.ts.getIfName();
 
         AstValType type;
         bool isMutable;
-        if (!ParseGlobalType(c, &type, &isMutable))
+        if (!ParseGlobalType(c, &type, &isMutable)) {
             return false;
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
-
-        if (!names.append(name))
+        }
+
+        if (!names.append(name)) {
             return false;
-        if (!mutability.append(isMutable))
+        }
+        if (!mutability.append(isMutable)) {
             return false;
-        if (!types.append(type))
+        }
+        if (!types.append(type)) {
             return false;
+        }
     }
 
     *st = AstStructType(std::move(names), std::move(mutability), std::move(types));
     return true;
 }
 
 static AstTypeDef*
 ParseTypeDef(WasmParseContext& c)
 {
     AstName name = c.ts.getIfName();
 
-    if (!c.ts.match(WasmToken::OpenParen, c.error))
+    if (!c.ts.match(WasmToken::OpenParen, c.error)) {
         return nullptr;
+    }
 
     AstTypeDef* type = nullptr;
     if (c.ts.getIf(WasmToken::Func)) {
         AstFuncType funcType(c.lifo);
-        if (!ParseFuncSig(c, &funcType))
+        if (!ParseFuncSig(c, &funcType)) {
             return nullptr;
+        }
 
         type = new(c.lifo) AstFuncType(name, std::move(funcType));
     } else if (c.ts.getIf(WasmToken::Struct)) {
         AstStructType st(c.lifo);
-        if (!ParseStructFields(c, &st))
+        if (!ParseStructFields(c, &st)) {
             return nullptr;
+        }
 
         type = new(c.lifo) AstStructType(name, std::move(st));
     } else {
         c.ts.generateError(c.ts.peek(), "bad type definition", c.error);
         return nullptr;
     }
 
-    if (!c.ts.match(WasmToken::CloseParen, c.error))
+    if (!c.ts.match(WasmToken::CloseParen, c.error)) {
         return nullptr;
+    }
 
     return type;
 }
 
 static bool
 MaybeParseOwnerIndex(WasmParseContext& c)
 {
     if (c.ts.peek().kind() == WasmToken::Index) {
@@ -3569,25 +4051,28 @@ MaybeParseOwnerIndex(WasmParseContext& c
         }
     }
     return true;
 }
 
 static AstExpr*
 ParseInitializerExpression(WasmParseContext& c)
 {
-    if (!c.ts.match(WasmToken::OpenParen, c.error))
+    if (!c.ts.match(WasmToken::OpenParen, c.error)) {
         return nullptr;
+    }
 
     AstExpr* initExpr = ParseExprInsideParens(c);
-    if (!initExpr)
+    if (!initExpr) {
         return nullptr;
-
-    if (!c.ts.match(WasmToken::CloseParen, c.error))
+    }
+
+    if (!c.ts.match(WasmToken::CloseParen, c.error)) {
         return nullptr;
+    }
 
     return initExpr;
 }
 
 static bool
 ParseInitializerExpressionOrPassive(WasmParseContext& c, AstExpr** maybeInitExpr)
 {
 #ifdef ENABLE_WASM_BULKMEM_OPS
@@ -3603,51 +4088,57 @@ ParseInitializerExpressionOrPassive(Wasm
 
     *maybeInitExpr = initExpr;
     return true;
 }
 
 static AstDataSegment*
 ParseDataSegment(WasmParseContext& c)
 {
-    if (!MaybeParseOwnerIndex(c))
+    if (!MaybeParseOwnerIndex(c)) {
         return nullptr;
+    }
 
     AstExpr* offsetIfActive;
-    if (!ParseInitializerExpressionOrPassive(c, &offsetIfActive))
+    if (!ParseInitializerExpressionOrPassive(c, &offsetIfActive)) {
         return nullptr;
+    }
 
     AstNameVector fragments(c.lifo);
 
     WasmToken text;
     while (c.ts.getIf(WasmToken::Text, &text)) {
-        if (!fragments.append(text.text()))
+        if (!fragments.append(text.text())) {
             return nullptr;
+        }
     }
 
     return new(c.lifo) AstDataSegment(offsetIfActive, std::move(fragments));
 }
 
 static bool
 ParseLimits(WasmParseContext& c, Limits* limits, Shareable allowShared)
 {
     WasmToken initial;
-    if (!c.ts.match(WasmToken::Index, &initial, c.error))
-        return false;
+    if (!c.ts.match(WasmToken::Index, &initial, c.error)) {
+        return false;
+    }
 
     Maybe<uint32_t> maximum;
     WasmToken token;
-    if (c.ts.getIf(WasmToken::Index, &token))
+    if (c.ts.getIf(WasmToken::Index, &token)) {
         maximum.emplace(token.index());
+    }
 
     Shareable shared = Shareable::False;
     if (c.ts.getIf(WasmToken::Shared, &token)) {
         // A missing maximum is caught later.
-        if (allowShared == Shareable::True)
+        if (allowShared == Shareable::True) {
             shared = Shareable::True;
+        }
         else {
             c.ts.generateError(token, "'shared' not allowed", c.error);
             return false;
         }
     }
 
     *limits = Limits(initial.index(), maximum, shared);
     return true;
@@ -3657,82 +4148,95 @@ static bool
 ParseMemory(WasmParseContext& c, AstModule* module)
 {
     AstName name = c.ts.getIfName();
 
     WasmToken openParen;
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Import)) {
             InlineImport names;
-            if (!ParseInlineImport(c, &names))
+            if (!ParseInlineImport(c, &names)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
 
             Limits memory;
-            if (!ParseLimits(c, &memory, Shareable::True))
+            if (!ParseLimits(c, &memory, Shareable::True)) {
                 return false;
+            }
 
             auto* imp = new(c.lifo) AstImport(name, names.module.text(), names.field.text(),
                                               DefinitionKind::Memory, memory);
             return imp && module->append(imp);
         }
 
         if (c.ts.getIf(WasmToken::Export)) {
             AstRef ref = name.empty() ? AstRef(module->memories().length()) : AstRef(name);
-            if (!ParseInlineExport(c, DefinitionKind::Memory, module, ref))
+            if (!ParseInlineExport(c, DefinitionKind::Memory, module, ref)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
         } else {
             c.ts.unget(openParen);
         }
     }
 
     if (c.ts.getIf(WasmToken::OpenParen)) {
-        if (!c.ts.match(WasmToken::Data, c.error))
+        if (!c.ts.match(WasmToken::Data, c.error)) {
             return false;
+        }
 
         AstNameVector fragments(c.lifo);
 
         WasmToken data;
         size_t pages = 0;
         size_t totalLength = 0;
         while (c.ts.getIf(WasmToken::Text, &data)) {
-            if (!fragments.append(data.text()))
+            if (!fragments.append(data.text())) {
                 return false;
+            }
             totalLength += data.text().length();
         }
 
         if (fragments.length()) {
             AstExpr* offset = new(c.lifo) AstConst(LitVal(uint32_t(0)));
-            if (!offset)
+            if (!offset) {
                 return false;
+            }
 
             auto* segment = new(c.lifo) AstDataSegment(offset, std::move(fragments));
-            if (!segment || !module->append(segment))
+            if (!segment || !module->append(segment)) {
                 return false;
+            }
 
             pages = AlignBytes<size_t>(totalLength, PageSize) / PageSize;
-            if (pages != uint32_t(pages))
+            if (pages != uint32_t(pages)) {
                 return false;
-        }
-
-        if (!module->addMemory(name, Limits(pages, Some(pages), Shareable::False)))
+            }
+        }
+
+        if (!module->addMemory(name, Limits(pages, Some(pages), Shareable::False))) {
             return false;
-
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
+        }
 
         return true;
     }
 
     Limits memory;
-    if (!ParseLimits(c, &memory, Shareable::True))
-        return false;
+    if (!ParseLimits(c, &memory, Shareable::True)) {
+        return false;
+    }
 
     return module->addMemory(name, memory);
 }
 
 #ifdef ENABLE_WASM_GC
 // Custom section for experimental work.  The size of this section should always
 // be 1 byte, and that byte is a nonzero varint7 carrying the version number
 // being opted into.
@@ -3753,18 +4257,19 @@ ParseGcFeatureOptIn(WasmParseContext& c,
     return module->addGcFeatureOptIn(token.index());
 }
 #endif
 
 static bool
 ParseStartFunc(WasmParseContext& c, WasmToken token, AstModule* module)
 {
     AstRef func;
-    if (!c.ts.matchRef(&func, c.error))
-        return false;
+    if (!c.ts.matchRef(&func, c.error)) {
+        return false;
+    }
 
     if (!module->setStartFunc(AstStartFunc(func))) {
         c.ts.generateError(token, c.error);
         return false;
     }
 
     return true;
 }
@@ -3774,27 +4279,30 @@ ParseGlobalType(WasmParseContext& c, Ast
 {
     WasmToken openParen;
     *isMutable = false;
 
     // Either (mut T) or T, where T can be (ref U).
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Mutable)) {
             *isMutable = true;
-            if (!ParseValType(c, type))
+            if (!ParseValType(c, type)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
             return true;
         }
         c.ts.unget(openParen);
     }
 
-    if (!ParseValType(c, type))
-        return false;
+    if (!ParseValType(c, type)) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ParseElemType(WasmParseContext& c)
 {
     // Only AnyFunc is allowed at the moment.
@@ -3809,136 +4317,158 @@ ParseTableSig(WasmParseContext& c, Limit
 }
 
 static AstImport*
 ParseImport(WasmParseContext& c, AstModule* module)
 {
     AstName name = c.ts.getIfName();
 
     WasmToken moduleName;
-    if (!c.ts.match(WasmToken::Text, &moduleName, c.error))
+    if (!c.ts.match(WasmToken::Text, &moduleName, c.error)) {
         return nullptr;
+    }
 
     WasmToken fieldName;
-    if (!c.ts.match(WasmToken::Text, &fieldName, c.error))
+    if (!c.ts.match(WasmToken::Text, &fieldName, c.error)) {
         return nullptr;
+    }
 
     AstRef funcTypeRef;
     WasmToken openParen;
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Memory)) {
-            if (name.empty())
+            if (name.empty()) {
                 name = c.ts.getIfName();
+            }
 
             Limits memory;
-            if (!ParseLimits(c, &memory, Shareable::True))
+            if (!ParseLimits(c, &memory, Shareable::True)) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(),
                                          DefinitionKind::Memory, memory);
         }
         if (c.ts.getIf(WasmToken::Table)) {
-            if (name.empty())
+            if (name.empty()) {
                 name = c.ts.getIfName();
+            }
 
             Limits table;
-            if (!ParseTableSig(c, &table))
+            if (!ParseTableSig(c, &table)) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(),
                                          DefinitionKind::Table, table);
         }
         if (c.ts.getIf(WasmToken::Global)) {
-            if (name.empty())
+            if (name.empty()) {
                 name = c.ts.getIfName();
+            }
 
             AstValType type;
             bool isMutable;
-            if (!ParseGlobalType(c, &type, &isMutable))
+            if (!ParseGlobalType(c, &type, &isMutable)) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
 
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(),
                                          AstGlobal(AstName(), type, isMutable));
         }
         if (c.ts.getIf(WasmToken::Func)) {
-            if (name.empty())
+            if (name.empty()) {
                 name = c.ts.getIfName();
+            }
 
             AstRef funcTypeRef;
-            if (!ParseFuncType(c, &funcTypeRef, module))
+            if (!ParseFuncType(c, &funcTypeRef, module)) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
 
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(), funcTypeRef);
         }
 
         if (c.ts.getIf(WasmToken::Type)) {
-            if (!c.ts.matchRef(&funcTypeRef, c.error))
+            if (!c.ts.matchRef(&funcTypeRef, c.error)) {
                 return nullptr;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return nullptr;
+            }
         } else {
             c.ts.unget(openParen);
         }
     }
 
     if (funcTypeRef.isInvalid()) {
         AstFuncType funcType(c.lifo);
-        if (!ParseFuncSig(c, &funcType))
+        if (!ParseFuncSig(c, &funcType)) {
             return nullptr;
+        }
 
         uint32_t funcTypeIndex;
-        if (!module->declare(std::move(funcType), &funcTypeIndex))
+        if (!module->declare(std::move(funcType), &funcTypeIndex)) {
             return nullptr;
+        }
         funcTypeRef.setIndex(funcTypeIndex);
     }
 
     return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(), funcTypeRef);
 }
 
 static AstExport*
 ParseExport(WasmParseContext& c)
 {
     WasmToken name;
-    if (!c.ts.match(WasmToken::Text, &name, c.error))
+    if (!c.ts.match(WasmToken::Text, &name, c.error)) {
         return nullptr;
+    }
 
     WasmToken exportee = c.ts.get();
     switch (exportee.kind()) {
       case WasmToken::Index:
         if (exportee.index() == AstNoIndex) {
             c.ts.generateError(exportee, c.error);
             return nullptr;
         }
         return new(c.lifo) AstExport(name.text(), DefinitionKind::Function,
                                      AstRef(exportee.index()));
       case WasmToken::Name:
         return new(c.lifo) AstExport(name.text(), DefinitionKind::Function,
                                      AstRef(exportee.name()));
       case WasmToken::Table: {
         AstRef ref;
-        if (!c.ts.getIfRef(&ref))
+        if (!c.ts.getIfRef(&ref)) {
             ref = AstRef(0);
+        }
         return new(c.lifo) AstExport(name.text(), DefinitionKind::Table, ref);
       }
       case WasmToken::Memory: {
         AstRef ref;
-        if (!c.ts.getIfRef(&ref))
+        if (!c.ts.getIfRef(&ref)) {
             ref = AstRef(0);
+        }
         return new(c.lifo) AstExport(name.text(), DefinitionKind::Memory, ref);
       }
       case WasmToken::Global: {
         AstRef ref;
-        if (!c.ts.matchRef(&ref, c.error))
+        if (!c.ts.matchRef(&ref, c.error)) {
             return nullptr;
+        }
         return new(c.lifo) AstExport(name.text(), DefinitionKind::Global, ref);
       }
       case WasmToken::OpenParen: {
         exportee = c.ts.get();
 
         DefinitionKind kind;
         switch (exportee.kind()) {
           case WasmToken::Func:
@@ -3954,20 +4484,22 @@ ParseExport(WasmParseContext& c)
             kind = DefinitionKind::Global;
             break;
           default:
             c.ts.generateError(exportee, c.error);
             return nullptr;
         }
 
         AstRef ref;
-        if (!c.ts.matchRef(&ref, c.error))
+        if (!c.ts.matchRef(&ref, c.error)) {
             return nullptr;
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return nullptr;
+        }
 
         return new(c.lifo) AstExport(name.text(), kind, ref);
       }
       default:
         break;
     }
 
     c.ts.generateError(exportee, c.error);
@@ -3978,102 +4510,119 @@ static bool
 ParseTable(WasmParseContext& c, WasmToken token, AstModule* module)
 {
     AstName name = c.ts.getIfName();
 
     if (c.ts.getIf(WasmToken::OpenParen)) {
         // Either an import and we're done, or an export and continue.
         if (c.ts.getIf(WasmToken::Import)) {
             InlineImport names;
-            if (!ParseInlineImport(c, &names))
+            if (!ParseInlineImport(c, &names)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
 
             Limits table;
-            if (!ParseTableSig(c, &table))
+            if (!ParseTableSig(c, &table)) {
                 return false;
+            }
 
             auto* import = new(c.lifo) AstImport(name, names.module.text(), names.field.text(),
                                                  DefinitionKind::Table, table);
 
             return import && module->append(import);
         }
 
         if (!c.ts.match(WasmToken::Export, c.error)) {
             c.ts.generateError(token, c.error);
             return false;
         }
 
         AstRef ref = name.empty() ? AstRef(module->tables().length()) : AstRef(name);
-        if (!ParseInlineExport(c, DefinitionKind::Table, module, ref))
+        if (!ParseInlineExport(c, DefinitionKind::Table, module, ref)) {
             return false;
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return false;
+        }
     }
 
     // Either: min max? anyfunc
     if (c.ts.peek().kind() == WasmToken::Index) {
         Limits table;
-        if (!ParseTableSig(c, &table))
+        if (!ParseTableSig(c, &table)) {
             return false;
+        }
         return module->addTable(name, table);
     }
 
     // Or: anyfunc (elem 1 2 ...)
-    if (!ParseElemType(c))
-        return false;
-
-    if (!c.ts.match(WasmToken::OpenParen, c.error))
-        return false;
-    if (!c.ts.match(WasmToken::Elem, c.error))
-        return false;
+    if (!ParseElemType(c)) {
+        return false;
+    }
+
+    if (!c.ts.match(WasmToken::OpenParen, c.error)) {
+        return false;
+    }
+    if (!c.ts.match(WasmToken::Elem, c.error)) {
+        return false;
+    }
 
     AstRefVector elems(c.lifo);
 
     AstRef elem;
     while (c.ts.getIfRef(&elem)) {
-        if (!elems.append(elem))
+        if (!elems.append(elem)) {
             return false;
-    }
-
-    if (!c.ts.match(WasmToken::CloseParen, c.error))
-        return false;
+        }
+    }
+
+    if (!c.ts.match(WasmToken::CloseParen, c.error)) {
+        return false;
+    }
 
     uint32_t numElements = uint32_t(elems.length());
-    if (numElements != elems.length())
-        return false;
-
-    if (!module->addTable(name, Limits(numElements, Some(numElements), Shareable::False)))
-        return false;
+    if (numElements != elems.length()) {
+        return false;
+    }
+
+    if (!module->addTable(name, Limits(numElements, Some(numElements), Shareable::False))) {
+        return false;
+    }
 
     auto* zero = new(c.lifo) AstConst(LitVal(uint32_t(0)));
-    if (!zero)
-        return false;
+    if (!zero) {
+        return false;
+    }
 
     AstElemSegment* segment = new(c.lifo) AstElemSegment(zero, std::move(elems));
     return segment && module->append(segment);
 }
 
 static AstElemSegment*
 ParseElemSegment(WasmParseContext& c)
 {
-    if (!MaybeParseOwnerIndex(c))
+    if (!MaybeParseOwnerIndex(c)) {
         return nullptr;
+    }
 
     AstExpr* offsetIfActive;
-    if (!ParseInitializerExpressionOrPassive(c, &offsetIfActive))
+    if (!ParseInitializerExpressionOrPassive(c, &offsetIfActive)) {
         return nullptr;
+    }
 
     AstRefVector elems(c.lifo);
 
     AstRef elem;
     while (c.ts.getIfRef(&elem)) {
-        if (!elems.append(elem))
+        if (!elems.append(elem)) {
             return nullptr;
+        }
     }
 
     return new(c.lifo) AstElemSegment(offsetIfActive, std::move(elems));
 }
 
 static bool
 ParseGlobal(WasmParseContext& c, AstModule* module)
 {
@@ -4086,175 +4635,202 @@ ParseGlobal(WasmParseContext& c, AstModu
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Import)) {
             if (module->globals().length()) {
                 c.ts.generateError(openParen, "import after global definition", c.error);
                 return false;
             }
 
             InlineImport names;
-            if (!ParseInlineImport(c, &names))
+            if (!ParseInlineImport(c, &names)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
-
-            if (!ParseGlobalType(c, &type, &isMutable))
+            }
+
+            if (!ParseGlobalType(c, &type, &isMutable)) {
                 return false;
+            }
 
             auto* imp = new(c.lifo) AstImport(name, names.module.text(), names.field.text(),
                                               AstGlobal(AstName(), type, isMutable));
             return imp && module->append(imp);
         }
 
         if (c.ts.getIf(WasmToken::Export)) {
             size_t refIndex = module->numGlobalImports() + module->globals().length();
             AstRef ref = name.empty() ? AstRef(refIndex) : AstRef(name);
-            if (!ParseInlineExport(c, DefinitionKind::Global, module, ref))
+            if (!ParseInlineExport(c, DefinitionKind::Global, module, ref)) {
                 return false;
-            if (!c.ts.match(WasmToken::CloseParen, c.error))
+            }
+            if (!c.ts.match(WasmToken::CloseParen, c.error)) {
                 return false;
+            }
         } else {
             c.ts.unget(openParen);
         }
     }
 
-    if (!ParseGlobalType(c, &type, &isMutable))
-        return false;
+    if (!ParseGlobalType(c, &type, &isMutable)) {
+        return false;
+    }
 
     AstExpr* init = ParseInitializerExpression(c);
-    if (!init)
-        return false;
+    if (!init) {
+        return false;
+    }
 
     auto* glob = new(c.lifo) AstGlobal(name, type, isMutable, Some(init));
     return glob && module->append(glob);
 }
 
 static AstModule*
 ParseBinaryModule(WasmParseContext& c, AstModule* module)
 {
     // By convention with EncodeBinaryModule, a binary module only contains a
     // data section containing the raw bytes contained in the module.
     AstNameVector fragments(c.lifo);
 
     WasmToken text;
     while (c.ts.getIf(WasmToken::Text, &text)) {
-        if (!fragments.append(text.text()))
+        if (!fragments.append(text.text())) {
             return nullptr;
+        }
     }
 
     auto* data = new(c.lifo) AstDataSegment(nullptr, std::move(fragments));
-    if (!data || !module->append(data))
+    if (!data || !module->append(data)) {
         return nullptr;
+    }
 
     return module;
 }
 
 static AstModule*
 ParseModule(const char16_t* text, uintptr_t stackLimit, LifoAlloc& lifo, UniqueChars* error,
             bool* binary)
 {
     WasmParseContext c(text, stackLimit, lifo, error);
 
     *binary = false;
 
-    if (!c.ts.match(WasmToken::OpenParen, c.error))
+    if (!c.ts.match(WasmToken::OpenParen, c.error)) {
         return nullptr;
-    if (!c.ts.match(WasmToken::Module, c.error))
+    }
+    if (!c.ts.match(WasmToken::Module, c.error)) {
         return nullptr;
+    }
 
     auto* module = new(c.lifo) AstModule(c.lifo);
-    if (!module)
+    if (!module) {
         return nullptr;
+    }
 
     if (c.ts.peek().kind() == WasmToken::Text) {
         *binary = true;
         return ParseBinaryModule(c, module);
     }
 
     while (c.ts.getIf(WasmToken::OpenParen)) {
         WasmToken section = c.ts.get();
 
         switch (section.kind()) {
           case WasmToken::Type: {
             AstTypeDef* typeDef = ParseTypeDef(c);
-            if (!typeDef)
+            if (!typeDef) {
                 return nullptr;
-            if (!module->append(typeDef))
+            }
+            if (!module->append(typeDef)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Start: {
-            if (!ParseStartFunc(c, section, module))
+            if (!ParseStartFunc(c, section, module)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Memory: {
-            if (!ParseMemory(c, module))
+            if (!ParseMemory(c, module)) {
                 return nullptr;
+            }
             break;
           }
 #ifdef ENABLE_WASM_GC
           case WasmToken::GcFeatureOptIn: {
-            if (!ParseGcFeatureOptIn(c, module))
+            if (!ParseGcFeatureOptIn(c, module)) {
                 return nullptr;
+            }
             break;
           }
 #endif
           case WasmToken::Global: {
-            if (!ParseGlobal(c, module))
+            if (!ParseGlobal(c, module)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Data: {
             AstDataSegment* segment = ParseDataSegment(c);
-            if (!segment || !module->append(segment))
+            if (!segment || !module->append(segment)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Import: {
             AstImport* imp = ParseImport(c, module);
-            if (!imp || !module->append(imp))
+            if (!imp || !module->append(imp)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Export: {
             AstExport* exp = ParseExport(c);
-            if (!exp || !module->append(exp))
+            if (!exp || !module->append(exp)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Table: {
-            if (!ParseTable(c, section, module))
+            if (!ParseTable(c, section, module)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Elem: {
             AstElemSegment* segment = ParseElemSegment(c);
-            if (!segment || !module->append(segment))
+            if (!segment || !module->append(segment)) {
                 return nullptr;
+            }
             break;
           }
           case WasmToken::Func: {
-            if (!ParseFunc(c, module))
+            if (!ParseFunc(c, module)) {
                 return nullptr;
+            }
             break;
           }
           default:
             c.ts.generateError(section, c.error);
             return nullptr;
         }
 
-        if (!c.ts.match(WasmToken::CloseParen, c.error))
+        if (!c.ts.match(WasmToken::CloseParen, c.error)) {
             return nullptr;
-    }
-
-    if (!c.ts.match(WasmToken::CloseParen, c.error))
+        }
+    }
+
+    if (!c.ts.match(WasmToken::CloseParen, c.error)) {
         return nullptr;
-    if (!c.ts.match(WasmToken::EndOfFile, c.error))
+    }
+    if (!c.ts.match(WasmToken::EndOfFile, c.error)) {
         return nullptr;
+    }
 
     return module;
 }
 
 /*****************************************************************************/
 // wasm name resolution
 
 namespace {
@@ -4270,18 +4846,19 @@ class Resolver
     AstNameMap tableMap_;
     AstNameMap memoryMap_;
     AstNameMap typeMap_;
     AstNameVector targetStack_;
 
     bool registerName(AstNameMap& map, AstName name, size_t index) {
         AstNameMap::AddPtr p = map.lookupForAdd(name);
         if (!p) {
-            if (!map.add(p, name, index))
+            if (!map.add(p, name, index)) {
                 return false;
+            }
         } else {
             return false;
         }
         return true;
     }
     bool resolveRef(AstNameMap& map, AstRef& ref) {
         AstNameMap::Ptr p = map.lookup(ref.name());
         if (p) {
@@ -4352,18 +4929,19 @@ class Resolver
     RESOLVE(globalMap_, Global)
     RESOLVE(tableMap_, Table)
     RESOLVE(memoryMap_, Memory)
     RESOLVE(typeMap_, Type)
 
 #undef RESOLVE
 
     bool resolveBranchTarget(AstRef& ref) {
-        if (ref.name().empty())
+        if (ref.name().empty()) {
             return true;
+        }
         for (size_t i = 0, e = targetStack_.length(); i < e; i++) {
             if (targetStack_[e - i - 1] == ref.name()) {
                 ref.setIndex(i);
                 return true;
             }
         }
         return failResolveLabel("branch target", ref.name());
     }
@@ -4374,123 +4952,140 @@ class Resolver
     }
 };
 
 } // end anonymous namespace
 
 static bool
 ResolveType(Resolver& r, AstValType& vt)
 {
-    if (vt.isResolved())
+    if (vt.isResolved()) {
         return true;
-    if (!r.resolveType(vt.asRef()))
-        return false;
+    }
+    if (!r.resolveType(vt.asRef())) {
+        return false;
+    }
     vt.resolve();
     return true;
 }
 
 static bool
 ResolveType(Resolver& r, AstExprType& et)
 {
-    if (et.isResolved())
+    if (et.isResolved()) {
         return true;
-    if (!ResolveType(r, et.asAstValType()))
-        return false;
+    }
+    if (!ResolveType(r, et.asAstValType())) {
+        return false;
+    }
     et.resolve();
     return true;
 }
 
 static bool
 ResolveExpr(Resolver& r, AstExpr& expr);
 
 static bool
 ResolveExprList(Resolver& r, const AstExprVector& v)
 {
     for (size_t i = 0; i < v.length(); i++) {
-        if (!ResolveExpr(r, *v[i]))
+        if (!ResolveExpr(r, *v[i])) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 ResolveBlock(Resolver& r, AstBlock& b)
 {
-    if (!r.pushTarget(b.name()))
-        return false;
-
-    if (!ResolveType(r, b.type()))
-        return false;
-
-    if (!ResolveExprList(r, b.exprs()))
-        return false;
+    if (!r.pushTarget(b.name())) {
+        return false;
+    }
+
+    if (!ResolveType(r, b.type())) {
+        return false;
+    }
+
+    if (!ResolveExprList(r, b.exprs())) {
+        return false;
+    }
 
     r.popTarget(b.name());
     return true;
 }
 
 static bool
 ResolveDropOperator(Resolver& r, AstDrop& drop)
 {
     return ResolveExpr(r, drop.value());
 }
 
 static bool
 ResolveBranch(Resolver& r, AstBranch& br)
 {
-    if (!r.resolveBranchTarget(br.target()))
-        return false;
-
-    if (br.maybeValue() && !ResolveExpr(r, *br.maybeValue()))
-        return false;
+    if (!r.resolveBranchTarget(br.target())) {
+        return false;
+    }
+
+    if (br.maybeValue() && !ResolveExpr(r, *br.maybeValue())) {
+        return false;
+    }
 
     if (br.op() == Op::BrIf) {
-        if (!ResolveExpr(r, br.cond()))
+        if (!ResolveExpr(r, br.cond())) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 ResolveArgs(Resolver& r, const AstExprVector& args)
 {
     for (AstExpr* arg : args) {
-        if (!ResolveExpr(r, *arg))
+        if (!ResolveExpr(r, *arg)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 ResolveCall(Resolver& r, AstCall& c)
 {
     MOZ_ASSERT(c.op() == Op::Call);
 
-    if (!ResolveArgs(r, c.args()))
-        return false;
-
-    if (!r.resolveFunction(c.func()))
-        return false;
+    if (!ResolveArgs(r, c.args())) {
+        return false;
+    }
+
+    if (!r.resolveFunction(c.func())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ResolveCallIndirect(Resolver& r, AstCallIndirect& c)
 {
-    if (!ResolveArgs(r, c.args()))
-        return false;
-
-    if (!ResolveExpr(r, *c.index()))
-        return false;
-
-    if (!r.resolveSignature(c.funcType()))
-        return false;
+    if (!ResolveArgs(r, c.args())) {
+        return false;
+    }
+
+    if (!ResolveExpr(r, *c.index())) {
+        return false;
+    }
+
+    if (!r.resolveSignature(c.funcType())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ResolveFirst(Resolver& r, AstFirst& f)
 {
     return ResolveExprList(r, f.exprs());
@@ -4500,51 +5095,57 @@ static bool
 ResolveGetLocal(Resolver& r, AstGetLocal& gl)
 {
     return r.resolveLocal(gl.local());
 }
 
 static bool
 ResolveSetLocal(Resolver& r, AstSetLocal& sl)
 {
-    if (!ResolveExpr(r, sl.value()))
-        return false;
-
-    if (!r.resolveLocal(sl.local()))
-        return false;
+    if (!ResolveExpr(r, sl.value())) {
+        return false;
+    }
+
+    if (!r.resolveLocal(sl.local())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ResolveGetGlobal(Resolver& r, AstGetGlobal& gl)
 {
     return r.resolveGlobal(gl.global());
 }
 
 static bool
 ResolveSetGlobal(Resolver& r, AstSetGlobal& sl)
 {
-    if (!ResolveExpr(r, sl.value()))
-        return false;
-
-    if (!r.resolveGlobal(sl.global()))
-        return false;
+    if (!ResolveExpr(r, sl.value())) {
+        return false;
+    }
+
+    if (!r.resolveGlobal(sl.global())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ResolveTeeLocal(Resolver& r, AstTeeLocal& sl)
 {
-    if (!ResolveExpr(r, sl.value()))
-        return false;
-
-    if (!r.resolveLocal(sl.local()))
-        return false;
+    if (!ResolveExpr(r, sl.value())) {
+        return false;
+    }
+
+    if (!r.resolveLocal(sl.local())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 ResolveUnaryOperator(Resolver& r, AstUnaryOperator& b)
 {
     return ResolveExpr(r, *b.operand());
@@ -4590,27 +5191,32 @@ ResolveExtraConversionOperator(Resolver&
 {
     return ResolveExpr(r, *b.operand());
 }
 #endif
 
 static bool
 ResolveIfElse(Resolver& r, AstIf& i)
 {
-    if (!ResolveType(r, i.type()))
-        return false;
-    if (!ResolveExpr(r, i.cond()))
-        return false;
-    if (!r.pushTarget(i.name()))
-        return false;
-    if (!ResolveExprList(r, i.thenExprs()))
-        return false;
+    if (!ResolveType(r, i.type())) {
+        return false;
+    }
+    if (!ResolveExpr(r, i.cond())) {
+        return false;
+    }
+    if (!r.pushTarget(i.name())) {
+        return false;
+    }
+    if (!ResolveExprList(r, i.thenExprs())) {
+        return false;
+    }
     if (i.hasElse()) {
-        if (!ResolveExprList(r, i.elseExprs()))
+        if (!ResolveExprList(r, i.elseExprs())) {
             return false;
+        }
     }
     r.popTarget(i.name());
     return true;
 }
 
 static bool
 ResolveLoadStoreAddress(Resolver& r, const AstLoadStoreAddress &address)
 {
@@ -4634,26 +5240,29 @@ static bool
 ResolveReturn(Resolver& r, AstReturn& ret)
 {
     return !ret.maybeExpr() || ResolveExpr(r, *ret.maybeExpr());
 }
 
 static bool
 ResolveBranchTable(Resolver& r, AstBranchTable& bt)
 {
-    if (!r.resolveBranchTarget(bt.def()))
-        return false;
+    if (!r.resolveBranchTarget(bt.def())) {
+        return false;
+    }
 
     for (AstRef& elem : bt.table()) {
-        if (!r.resolveBranchTarget(elem))
+        if (!r.resolveBranchTarget(elem)) {
             return false;
-    }
-
-    if (bt.maybeValue() && !ResolveExpr(r, *bt.maybeValue()))
-        return false;
+        }
+    }
+
+    if (bt.maybeValue() && !ResolveExpr(r, *bt.maybeValue())) {
+        return false;
+    }
 
     return ResolveExpr(r, bt.index());
 }
 
 static bool
 ResolveAtomicCmpXchg(Resolver& r, AstAtomicCmpXchg& s)
 {
     return ResolveLoadStoreAddress(r, s.address()) &&
@@ -4816,302 +5425,353 @@ ResolveExpr(Resolver& r, AstExpr& expr)
 }
 
 static bool
 ResolveFunc(Resolver& r, AstFunc& func)
 {
     r.beginFunc();
 
     for (AstValType& vt : func.vars()) {
-        if (!ResolveType(r, vt))
+        if (!ResolveType(r, vt)) {
             return false;
+        }
     }
 
     for (size_t i = 0; i < func.locals().length(); i++) {
-        if (!r.registerVarName(func.locals()[i], i))
+        if (!r.registerVarName(func.locals()[i], i)) {
             return r.fail("duplicate var");
+        }
     }
 
     for (AstExpr* expr : func.body()) {
-        if (!ResolveExpr(r, *expr))
+        if (!ResolveExpr(r, *expr)) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 ResolveSignature(Resolver& r, AstFuncType& ft)
 {
     for (AstValType& vt : ft.args()) {
-        if (!ResolveType(r, vt))
+        if (!ResolveType(r, vt)) {
             return false;
+        }
     }
     return ResolveType(r, ft.ret());
 }
 
 static bool
 ResolveStruct(Resolver& r, AstStructType& s)
 {
     for (AstValType& vt : s.fieldTypes()) {
-        if (!ResolveType(r, vt))
+        if (!ResolveType(r, vt)) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 ResolveModule(LifoAlloc& lifo, AstModule* module, UniqueChars* error)
 {
     Resolver r(lifo, error);
 
     size_t numTypes = module->types().length();
     for (size_t i = 0; i < numTypes; i++) {
         AstTypeDef* td = module->types()[i];
         if (td->isFuncType()) {
             AstFuncType* funcType = &td->asFuncType();
-            if (!r.registerFuncTypeName(funcType->name(), i))
+            if (!r.registerFuncTypeName(funcType->name(), i)) {
                 return r.fail("duplicate signature");
+            }
         } else if (td->isStructType()) {
             AstStructType* structType = &td->asStructType();
-            if (!r.registerTypeName(structType->name(), i))
+            if (!r.registerTypeName(structType->name(), i)) {
                 return r.fail("duplicate type name");
+            }
         } else {
             MOZ_CRASH("Bad type");
         }
     }
 
     for (size_t i = 0; i < numTypes; i++) {
         AstTypeDef* td = module->types()[i];
         if (td->isFuncType()) {
             AstFuncType* funcType = &td->asFuncType();
-            if (!ResolveSignature(r, *funcType))
+            if (!ResolveSignature(r, *funcType)) {
                 return false;
+            }
         } else if (td->isStructType()) {
             AstStructType* structType = &td->asStructType();
-            if (!ResolveStruct(r, *structType))
+            if (!ResolveStruct(r, *structType)) {
                 return false;
+            }
         } else {
             MOZ_CRASH("Bad type");
         }
     }
 
     size_t lastFuncIndex = 0;
     size_t lastGlobalIndex = 0;
     size_t lastMemoryIndex = 0;
     size_t lastTableIndex = 0;
     for (AstImport* imp : module->imports()) {
         switch (imp->kind()) {
           case DefinitionKind::Function:
-            if (!r.registerFuncName(imp->name(), lastFuncIndex++))
+            if (!r.registerFuncName(imp->name(), lastFuncIndex++)) {
                 return r.fail("duplicate import");
-            if (!r.resolveSignature(imp->funcType()))
+            }
+            if (!r.resolveSignature(imp->funcType())) {
                 return false;
+            }
             break;
           case DefinitionKind::Global:
-            if (!r.registerGlobalName(imp->name(), lastGlobalIndex++))
+            if (!r.registerGlobalName(imp->name(), lastGlobalIndex++)) {
                 return r.fail("duplicate import");
-            if (!ResolveType(r, imp->global().type()))
+            }
+            if (!ResolveType(r, imp->global().type())) {
                 return false;
+            }
             break;
           case DefinitionKind::Memory:
-            if (!r.registerMemoryName(imp->name(), lastMemoryIndex++))
+            if (!r.registerMemoryName(imp->name(), lastMemoryIndex++)) {
                 return r.fail("duplicate import");
+            }
             break;
           case DefinitionKind::Table:
-            if (!r.registerTableName(imp->name(), lastTableIndex++))
+            if (!r.registerTableName(imp->name(), lastTableIndex++)) {
                 return r.fail("duplicate import");
+            }
             break;
         }
     }
 
     for (AstFunc* func : module->funcs()) {
-        if (!r.resolveSignature(func->funcType()))
+        if (!r.resolveSignature(func->funcType())) {
             return false;
-        if (!r.registerFuncName(func->name(), lastFuncIndex++))
+        }
+        if (!r.registerFuncName(func->name(), lastFuncIndex++)) {
             return r.fail("duplicate function");
+        }
     }
 
     for (AstGlobal* global : module->globals()) {
-        if (!r.registerGlobalName(global->name(), lastGlobalIndex++))
+        if (!r.registerGlobalName(global->name(), lastGlobalIndex++)) {
             return r.fail("duplicate import");
-        if (!ResolveType(r, global->type()))
+        }
+        if (!ResolveType(r, global->type())) {
             return false;
-        if (global->hasInit() && !ResolveExpr(r, global->init()))
+        }
+        if (global->hasInit() && !ResolveExpr(r, global->init())) {
             return false;
+        }
     }
 
     for (const AstResizable& table : module->tables()) {
-        if (table.imported)
+        if (table.imported) {
             continue;
-        if (!r.registerTableName(table.name, lastTableIndex++))
+        }
+        if (!r.registerTableName(table.name, lastTableIndex++)) {
             return r.fail("duplicate import");
+        }
     }
 
     for (const AstResizable& memory : module->memories()) {
-        if (memory.imported)
+        if (memory.imported) {
             continue;
-        if (!r.registerMemoryName(memory.name, lastMemoryIndex++))
+        }
+        if (!r.registerMemoryName(memory.name, lastMemoryIndex++)) {
             return r.fail("duplicate import");
+        }
     }
 
     for (AstExport* export_ : module->exports()) {
         switch (export_->kind()) {
           case DefinitionKind::Function:
-            if (!r.resolveFunction(export_->ref()))
+            if (!r.resolveFunction(export_->ref())) {
                 return false;
+            }
             break;
           case DefinitionKind::Global:
-            if (!r.resolveGlobal(export_->ref()))
+            if (!r.resolveGlobal(export_->ref())) {
                 return false;
+            }
             break;
           case DefinitionKind::Table:
-            if (!r.resolveTable(export_->ref()))
+            if (!r.resolveTable(export_->ref())) {
                 return false;
+            }
             break;
           case DefinitionKind::Memory:
-            if (!r.resolveMemory(export_->ref()))
+            if (!r.resolveMemory(export_->ref())) {
                 return false;
+            }
             break;
         }
     }
 
     for (AstFunc* func : module->funcs()) {
-        if (!ResolveFunc(r, *func))
+        if (!ResolveFunc(r, *func)) {
             return false;
+        }
     }
 
     if (module->hasStartFunc()) {
-        if (!r.resolveFunction(module->startFunc().func()))
+        if (!r.resolveFunction(module->startFunc().func())) {
             return false;
+        }
     }
 
     for (AstDataSegment* segment : module->dataSegments()) {
-        if (segment->offsetIfActive() && !ResolveExpr(r, *segment->offsetIfActive()))
+        if (segment->offsetIfActive() && !ResolveExpr(r, *segment->offsetIfActive())) {
             return false;
+        }
     }
 
     for (AstElemSegment* segment : module->elemSegments()) {
-        if (segment->offsetIfActive() && !ResolveExpr(r, *segment->offsetIfActive()))
+        if (segment->offsetIfActive() && !ResolveExpr(r, *segment->offsetIfActive())) {
             return false;
+        }
         for (AstRef& ref : segment->elems()) {
-            if (!r.resolveFunction(ref))
+            if (!r.resolveFunction(ref)) {
                 return false;
+            }
         }
     }
 
     return true;
 }
 
 /*****************************************************************************/
 // wasm function body serialization
 
 static bool
 EncodeExpr(Encoder& e, AstExpr& expr);
 
 static bool
 EncodeExprList(Encoder& e, const AstExprVector& v)
 {
     for (size_t i = 0; i < v.length(); i++) {
-        if (!EncodeExpr(e, *v[i]))
+        if (!EncodeExpr(e, *v[i])) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 EncodeBlock(Encoder& e, AstBlock& b)
 {
-    if (!e.writeOp(b.op()))
-        return false;
-
-    if (!e.writeBlockType(b.type().type()))
-        return false;
-
-    if (!EncodeExprList(e, b.exprs()))
-        return false;
-
-    if (!e.writeOp(Op::End))
-        return false;
+    if (!e.writeOp(b.op())) {
+        return false;
+    }
+
+    if (!e.writeBlockType(b.type().type())) {
+        return false;
+    }
+
+    if (!EncodeExprList(e, b.exprs())) {
+        return false;
+    }
+
+    if (!e.writeOp(Op::End)) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeBranch(Encoder& e, AstBranch& br)
 {
     MOZ_ASSERT(br.op() == Op::Br || br.op() == Op::BrIf);
 
     if (br.maybeValue()) {
-        if (!EncodeExpr(e, *br.maybeValue()))
+        if (!EncodeExpr(e, *br.maybeValue())) {
             return false;
+        }
     }
 
     if (br.op() == Op::BrIf) {
-        if (!EncodeExpr(e, br.cond()))
+        if (!EncodeExpr(e, br.cond())) {
             return false;
-    }
-
-    if (!e.writeOp(br.op()))
-        return false;
-
-    if (!e.writeVarU32(br.target().index()))
-        return false;
+        }
+    }
+
+    if (!e.writeOp(br.op())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(br.target().index())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeFirst(Encoder& e, AstFirst& f)
 {
     return EncodeExprList(e, f.exprs());
 }
 
 static bool
 EncodeArgs(Encoder& e, const AstExprVector& args)
 {
     for (AstExpr* arg : args) {
-        if (!EncodeExpr(e, *arg))
+        if (!EncodeExpr(e, *arg)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 EncodeCall(Encoder& e, AstCall& c)
 {
-    if (!EncodeArgs(e, c.args()))
-        return false;
-
-    if (!e.writeOp(c.op()))
-        return false;
-
-    if (!e.writeVarU32(c.func().index()))
-        return false;
+    if (!EncodeArgs(e, c.args())) {
+        return false;
+    }
+
+    if (!e.writeOp(c.op())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(c.func().index())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeCallIndirect(Encoder& e, AstCallIndirect& c)
 {
-    if (!EncodeArgs(e, c.args()))
-        return false;
-
-    if (!EncodeExpr(e, *c.index()))
-        return false;
-
-    if (!e.writeOp(Op::CallIndirect))
-        return false;
-
-    if (!e.writeVarU32(c.funcType().index()))
-        return false;
-
-    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default)))
-        return false;
+    if (!EncodeArgs(e, c.args())) {
+        return false;
+    }
+
+    if (!EncodeExpr(e, *c.index())) {
+        return false;
+    }
+
+    if (!e.writeOp(Op::CallIndirect)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(c.funcType().index())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default))) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeConst(Encoder& e, AstConst& c)
 {
     switch (c.val().type().code()) {
@@ -5224,30 +5884,35 @@ EncodeExtraConversionOperator(Encoder& e
     return EncodeExpr(e, *b.operand()) &&
            e.writeOp(b.op());
 }
 #endif
 
 static bool
 EncodeIf(Encoder& e, AstIf& i)
 {
-    if (!EncodeExpr(e, i.cond()) || !e.writeOp(Op::If))
-        return false;
-
-    if (!e.writeBlockType(i.type().type()))
-        return false;
-
-    if (!EncodeExprList(e, i.thenExprs()))
-        return false;
+    if (!EncodeExpr(e, i.cond()) || !e.writeOp(Op::If)) {
+        return false;
+    }
+
+    if (!e.writeBlockType(i.type().type())) {
+        return false;
+    }
+
+    if (!EncodeExprList(e, i.thenExprs())) {
+        return false;
+    }
 
     if (i.hasElse()) {
-        if (!e.writeOp(Op::Else))
+        if (!e.writeOp(Op::Else)) {
             return false;
-        if (!EncodeExprList(e, i.elseExprs()))
+        }
+        if (!EncodeExprList(e, i.elseExprs())) {
             return false;
+        }
     }
 
     return e.writeOp(Op::End);
 }
 
 static bool
 EncodeLoadStoreAddress(Encoder &e, const AstLoadStoreAddress &address)
 {
@@ -5277,77 +5942,90 @@ EncodeStore(Encoder& e, AstStore& s)
            e.writeOp(s.op()) &&
            EncodeLoadStoreFlags(e, s.address());
 }
 
 static bool
 EncodeReturn(Encoder& e, AstReturn& r)
 {
     if (r.maybeExpr()) {
-        if (!EncodeExpr(e, *r.maybeExpr()))
+        if (!EncodeExpr(e, *r.maybeExpr())) {
            return false;
-    }
-
-    if (!e.writeOp(Op::Return))
-        return false;
+        }
+    }
+
+    if (!e.writeOp(Op::Return)) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeBranchTable(Encoder& e, AstBranchTable& bt)
 {
     if (bt.maybeValue()) {
-        if (!EncodeExpr(e, *bt.maybeValue()))
+        if (!EncodeExpr(e, *bt.maybeValue())) {
             return false;
-    }
-
-    if (!EncodeExpr(e, bt.index()))
-        return false;
-
-    if (!e.writeOp(Op::BrTable))
-        return false;
-
-    if (!e.writeVarU32(bt.table().length()))
-        return false;
+        }
+    }
+
+    if (!EncodeExpr(e, bt.index())) {
+        return false;
+    }
+
+    if (!e.writeOp(Op::BrTable)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(bt.table().length())) {
+        return false;
+    }
 
     for (const AstRef& elem : bt.table()) {
-        if (!e.writeVarU32(elem.index()))
+        if (!e.writeVarU32(elem.index())) {
             return false;
-    }
-
-    if (!e.writeVarU32(bt.def().index()))
-        return false;
+        }
+    }
+
+    if (!e.writeVarU32(bt.def().index())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeCurrentMemory(Encoder& e, AstCurrentMemory& cm)
 {
-    if (!e.writeOp(Op::CurrentMemory))
-        return false;
-
-    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default)))
-        return false;
+    if (!e.writeOp(Op::CurrentMemory)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default))) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeGrowMemory(Encoder& e, AstGrowMemory& gm)
 {
-    if (!EncodeExpr(e, *gm.operand()))
-        return false;
-
-    if (!e.writeOp(Op::GrowMemory))
-        return false;
-
-    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default)))
-        return false;
+    if (!EncodeExpr(e, *gm.operand())) {
+        return false;
+    }
+
+    if (!e.writeOp(Op::GrowMemory)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(uint32_t(MemoryTableFlags::Default))) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeAtomicCmpXchg(Encoder& e, AstAtomicCmpXchg& s)
 {
     return EncodeLoadStoreAddress(e, s.address()) &&
@@ -5539,106 +6217,125 @@ EncodeExpr(Encoder& e, AstExpr& expr)
 /*****************************************************************************/
 // wasm AST binary serialization
 
 #ifdef ENABLE_WASM_GC
 static bool
 EncodeGcFeatureOptInSection(Encoder& e, AstModule& module)
 {
     uint32_t optInVersion = module.gcFeatureOptIn();
-    if (!optInVersion)
+    if (!optInVersion) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::GcFeatureOptIn, &offset))
-        return false;
-
-    if (!e.writeVarU32(optInVersion))
-        return false;
+    if (!e.startSection(SectionId::GcFeatureOptIn, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(optInVersion)) {
+        return false;
+    }
 
     e.finishSection(offset);
     return true;
 }
 #endif
 
 static bool
 EncodeTypeSection(Encoder& e, AstModule& module)
 {
-    if (module.types().empty())
+    if (module.types().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Type, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.types().length()))
-        return false;
+    if (!e.startSection(SectionId::Type, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.types().length())) {
+        return false;
+    }
 
     for (AstTypeDef* td : module.types()) {
         if (td->isFuncType()) {
             AstFuncType* funcType = &td->asFuncType();
-            if (!e.writeVarU32(uint32_t(TypeCode::Func)))
+            if (!e.writeVarU32(uint32_t(TypeCode::Func))) {
                 return false;
-
-            if (!e.writeVarU32(funcType->args().length()))
+            }
+
+            if (!e.writeVarU32(funcType->args().length())) {
                 return false;
+            }
 
             for (AstValType vt : funcType->args()) {
-                if (!e.writeValType(vt.type()))
+                if (!e.writeValType(vt.type())) {
                     return false;
-            }
-
-            if (!e.writeVarU32(!IsVoid(funcType->ret().type())))
+                }
+            }
+
+            if (!e.writeVarU32(!IsVoid(funcType->ret().type()))) {
                 return false;
+            }
 
             if (!IsVoid(funcType->ret().type())) {
-                if (!e.writeValType(NonVoidToValType(funcType->ret().type())))
+                if (!e.writeValType(NonVoidToValType(funcType->ret().type()))) {
                     return false;
+                }
             }
         } else if (td->isStructType()) {
             AstStructType* st = &td->asStructType();
-            if (!e.writeVarU32(uint32_t(TypeCode::Struct)))
+            if (!e.writeVarU32(uint32_t(TypeCode::Struct))) {
                 return false;
-
-            if (!e.writeVarU32(st->fieldTypes().length()))
+            }
+
+            if (!e.writeVarU32(st->fieldTypes().length())) {
                 return false;
+            }
 
             const AstValTypeVector& fieldTypes = st->fieldTypes();
             const AstBoolVector& fieldMutables = st->fieldMutability();
             for (uint32_t i = 0; i < fieldTypes.length(); i++) {
-                if (!e.writeFixedU8(fieldMutables[i] ? uint8_t(FieldFlags::Mutable) : 0))
+                if (!e.writeFixedU8(fieldMutables[i] ? uint8_t(FieldFlags::Mutable) : 0)) {
                     return false;
-                if (!e.writeValType(fieldTypes[i].type()))
+                }
+                if (!e.writeValType(fieldTypes[i].type())) {
                     return false;
+                }
             }
         } else {
             MOZ_CRASH("Bad type");
         }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeFunctionSection(Encoder& e, AstModule& module)
 {
-    if (module.funcs().empty())
+    if (module.funcs().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Function, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.funcs().length()))
-        return false;
+    if (!e.startSection(SectionId::Function, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.funcs().length())) {
+        return false;
+    }
 
     for (AstFunc* func : module.funcs()) {
-        if (!e.writeVarU32(func->funcType().index()))
+        if (!e.writeVarU32(func->funcType().index())) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeBytes(Encoder& e, AstName wasmName)
@@ -5649,296 +6346,350 @@ EncodeBytes(Encoder& e, AstName wasmName
 }
 
 static bool
 EncodeLimits(Encoder& e, const Limits& limits)
 {
     uint32_t flags = limits.maximum
                    ? uint32_t(MemoryTableFlags::HasMaximum)
                    : uint32_t(MemoryTableFlags::Default);
-    if (limits.shared == Shareable::True)
+    if (limits.shared == Shareable::True) {
         flags |= uint32_t(MemoryTableFlags::IsShared);
-
-    if (!e.writeVarU32(flags))
-        return false;
-
-    if (!e.writeVarU32(limits.initial))
-        return false;
+    }
+
+    if (!e.writeVarU32(flags)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(limits.initial)) {
+        return false;
+    }
 
     if (limits.maximum) {
-        if (!e.writeVarU32(*limits.maximum))
+        if (!e.writeVarU32(*limits.maximum)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 EncodeTableLimits(Encoder& e, const Limits& limits)
 {
-    if (!e.writeVarU32(uint32_t(TypeCode::AnyFunc)))
-        return false;
+    if (!e.writeVarU32(uint32_t(TypeCode::AnyFunc))) {
+        return false;
+    }
 
     return EncodeLimits(e, limits);
 }
 
 static bool
 EncodeGlobalType(Encoder& e, const AstGlobal* global)
 {
     return e.writeValType(global->type()) &&
            e.writeVarU32(global->isMutable() ? uint32_t(GlobalTypeImmediate::IsMutable) : 0);
 }
 
 static bool
 EncodeImport(Encoder& e, AstImport& imp)
 {
-    if (!EncodeBytes(e, imp.module()))
-        return false;
-
-    if (!EncodeBytes(e, imp.field()))
-        return false;
-
-    if (!e.writeVarU32(uint32_t(imp.kind())))
-        return false;
+    if (!EncodeBytes(e, imp.module())) {
+        return false;
+    }
+
+    if (!EncodeBytes(e, imp.field())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(uint32_t(imp.kind()))) {
+        return false;
+    }
 
     switch (imp.kind()) {
       case DefinitionKind::Function:
-        if (!e.writeVarU32(imp.funcType().index()))
+        if (!e.writeVarU32(imp.funcType().index())) {
             return false;
+        }
         break;
       case DefinitionKind::Global:
         MOZ_ASSERT(!imp.global().hasInit());
-        if (!EncodeGlobalType(e, &imp.global()))
+        if (!EncodeGlobalType(e, &imp.global())) {
             return false;
+        }
         break;
       case DefinitionKind::Table:
-        if (!EncodeTableLimits(e, imp.limits()))
+        if (!EncodeTableLimits(e, imp.limits())) {
             return false;
+        }
         break;
       case DefinitionKind::Memory:
-        if (!EncodeLimits(e, imp.limits()))
+        if (!EncodeLimits(e, imp.limits())) {
             return false;
+        }
         break;
     }
 
     return true;
 }
 
 static bool
 EncodeImportSection(Encoder& e, AstModule& module)
 {
-    if (module.imports().empty())
+    if (module.imports().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Import, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.imports().length()))
-        return false;
+    if (!e.startSection(SectionId::Import, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.imports().length())) {
+        return false;
+    }
 
     for (AstImport* imp : module.imports()) {
-        if (!EncodeImport(e, *imp))
+        if (!EncodeImport(e, *imp)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeMemorySection(Encoder& e, AstModule& module)
 {
     size_t numOwnMemories = 0;
     for (const AstResizable& memory : module.memories()) {
-        if (!memory.imported)
+        if (!memory.imported) {
             numOwnMemories++;
-    }
-
-    if (!numOwnMemories)
+        }
+    }
+
+    if (!numOwnMemories) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Memory, &offset))
-        return false;
-
-    if (!e.writeVarU32(numOwnMemories))
-        return false;
+    if (!e.startSection(SectionId::Memory, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(numOwnMemories)) {
+        return false;
+    }
 
     for (const AstResizable& memory : module.memories()) {
-        if (memory.imported)
+        if (memory.imported) {
             continue;
-        if (!EncodeLimits(e, memory.limits))
+        }
+        if (!EncodeLimits(e, memory.limits)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeGlobalSection(Encoder& e, AstModule& module)
 {
     size_t offset;
-    if (!e.startSection(SectionId::Global, &offset))
-        return false;
+    if (!e.startSection(SectionId::Global, &offset)) {
+        return false;
+    }
 
     const AstGlobalVector& globals = module.globals();
 
-    if (!e.writeVarU32(globals.length()))
-        return false;
+    if (!e.writeVarU32(globals.length())) {
+        return false;
+    }
 
     for (const AstGlobal* global : globals) {
         MOZ_ASSERT(global->hasInit());
-        if (!EncodeGlobalType(e, global))
+        if (!EncodeGlobalType(e, global)) {
+            return false;
+        }
+        if (!EncodeExpr(e, global->init())) {
             return false;
-        if (!EncodeExpr(e, global->init()))
+        }
+        if (!e.writeOp(Op::End)) {
             return false;
-        if (!e.writeOp(Op::End))
-            return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeExport(Encoder& e, AstExport& exp)
 {
-    if (!EncodeBytes(e, exp.name()))
-        return false;
-
-    if (!e.writeVarU32(uint32_t(exp.kind())))
-        return false;
-
-    if (!e.writeVarU32(exp.ref().index()))
-        return false;
+    if (!EncodeBytes(e, exp.name())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(uint32_t(exp.kind()))) {
+        return false;
+    }
+
+    if (!e.writeVarU32(exp.ref().index())) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeExportSection(Encoder& e, AstModule& module)
 {
     uint32_t numExports = module.exports().length();
-    if (!numExports)
+    if (!numExports) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Export, &offset))
-        return false;
-
-    if (!e.writeVarU32(numExports))
-        return false;
+    if (!e.startSection(SectionId::Export, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(numExports)) {
+        return false;
+    }
 
     for (AstExport* exp : module.exports()) {
-        if (!EncodeExport(e, *exp))
+        if (!EncodeExport(e, *exp)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeTableSection(Encoder& e, AstModule& module)
 {
     size_t numOwnTables = 0;
     for (const AstResizable& table : module.tables()) {
-        if (!table.imported)
+        if (!table.imported) {
             numOwnTables++;
-    }
-
-    if (!numOwnTables)
+        }
+    }
+
+    if (!numOwnTables) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Table, &offset))
-        return false;
-
-    if (!e.writeVarU32(numOwnTables))
-        return false;
+    if (!e.startSection(SectionId::Table, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(numOwnTables)) {
+        return false;
+    }
 
     for (const AstResizable& table : module.tables()) {
-        if (table.imported)
+        if (table.imported) {
             continue;
-        if (!EncodeTableLimits(e, table.limits))
+        }
+        if (!EncodeTableLimits(e, table.limits)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeFunctionBody(Encoder& e, Uint32Vector* offsets, AstFunc& func)
 {
     size_t bodySizeAt;
-    if (!e.writePatchableVarU32(&bodySizeAt))
-        return false;
+    if (!e.writePatchableVarU32(&bodySizeAt)) {
+        return false;
+    }
 
     size_t beforeBody = e.currentOffset();
 
     ValTypeVector varTypes;
     for (const AstValType& vt : func.vars()) {
-        if (!varTypes.append(vt.type()))
+        if (!varTypes.append(vt.type())) {
             return false;
-    }
-    if (!EncodeLocalEntries(e, varTypes))
-        return false;
+        }
+    }
+    if (!EncodeLocalEntries(e, varTypes)) {
+        return false;
+    }
 
     for (AstExpr* expr : func.body()) {
-        if (!offsets->append(e.currentOffset()))
+        if (!offsets->append(e.currentOffset())) {
             return false;
-        if (!EncodeExpr(e, *expr))
+        }
+        if (!EncodeExpr(e, *expr)) {
             return false;
-    }
-
-    if (!offsets->append(e.currentOffset()))
-        return false;
-    if (!e.writeOp(Op::End))
-        return false;
+        }
+    }
+
+    if (!offsets->append(e.currentOffset())) {
+        return false;
+    }
+    if (!e.writeOp(Op::End)) {
+        return false;
+    }
 
     e.patchVarU32(bodySizeAt, e.currentOffset() - beforeBody);
     return true;
 }
 
 static bool
 EncodeStartSection(Encoder& e, AstModule& module)
 {
-    if (!module.hasStartFunc())
+    if (!module.hasStartFunc()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Start, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.startFunc().func().index()))
-        return false;
+    if (!e.startSection(SectionId::Start, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.startFunc().func().index())) {
+        return false;
+    }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeCodeSection(Encoder& e, Uint32Vector* offsets, AstModule& module)
 {
-    if (module.funcs().empty())
+    if (module.funcs().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Code, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.funcs().length()))
-        return false;
+    if (!e.startSection(SectionId::Code, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.funcs().length())) {
+        return false;
+    }
 
     for (AstFunc* func : module.funcs()) {
-        if (!EncodeFunctionBody(e, offsets, *func))
+        if (!EncodeFunctionBody(e, offsets, *func)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeDestinationOffsetOrFlags(Encoder& e, AstExpr* offsetIfActive)
@@ -5959,26 +6710,29 @@ EncodeDestinationOffsetOrFlags(Encoder& 
     }
 
     return true;
 }
 
 static bool
 EncodeDataSegment(Encoder& e, const AstDataSegment& segment)
 {
-    if (!EncodeDestinationOffsetOrFlags(e, segment.offsetIfActive()))
-        return false;
+    if (!EncodeDestinationOffsetOrFlags(e, segment.offsetIfActive())) {
+        return false;
+    }
 
     size_t totalLength = 0;
-    for (const AstName& fragment : segment.fragments())
+    for (const AstName& fragment : segment.fragments()) {
         totalLength += fragment.length();
+    }
 
     Vector<uint8_t, 0, SystemAllocPolicy> bytes;
-    if (!bytes.reserve(totalLength))
-        return false;
+    if (!bytes.reserve(totalLength)) {
+        return false;
+    }
 
     for (const AstName& fragment : segment.fragments()) {
         const char16_t* cur = fragment.begin();
         const char16_t* end = fragment.end();
         while (cur != end) {
             uint8_t byte;
             MOZ_ALWAYS_TRUE(ConsumeTextByte(&cur, end, &byte));
             bytes.infallibleAppend(byte);
@@ -5986,122 +6740,147 @@ EncodeDataSegment(Encoder& e, const AstD
     }
 
     return e.writeBytes(bytes.begin(), bytes.length());
 }
 
 static bool
 EncodeDataSection(Encoder& e, AstModule& module)
 {
-    if (module.dataSegments().empty())
+    if (module.dataSegments().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Data, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.dataSegments().length()))
-        return false;
+    if (!e.startSection(SectionId::Data, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.dataSegments().length())) {
+        return false;
+    }
 
     for (AstDataSegment* segment : module.dataSegments()) {
-        if (!EncodeDataSegment(e, *segment))
+        if (!EncodeDataSegment(e, *segment)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeElemSegment(Encoder& e, AstElemSegment& segment)
 {
-    if (!EncodeDestinationOffsetOrFlags(e, segment.offsetIfActive()))
-        return false;
-
-    if (!e.writeVarU32(segment.elems().length()))
-        return false;
+    if (!EncodeDestinationOffsetOrFlags(e, segment.offsetIfActive())) {
+        return false;
+    }
+
+    if (!e.writeVarU32(segment.elems().length())) {
+        return false;
+    }
 
     for (const AstRef& elem : segment.elems()) {
-        if (!e.writeVarU32(elem.index()))
+        if (!e.writeVarU32(elem.index())) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 EncodeElemSection(Encoder& e, AstModule& module)
 {
-    if (module.elemSegments().empty())
+    if (module.elemSegments().empty()) {
         return true;
+    }
 
     size_t offset;
-    if (!e.startSection(SectionId::Elem, &offset))
-        return false;
-
-    if (!e.writeVarU32(module.elemSegments().length()))
-        return false;
+    if (!e.startSection(SectionId::Elem, &offset)) {
+        return false;
+    }
+
+    if (!e.writeVarU32(module.elemSegments().length())) {
+        return false;
+    }
 
     for (AstElemSegment* segment : module.elemSegments()) {
-        if (!EncodeElemSegment(e, *segment))
+        if (!EncodeElemSegment(e, *segment)) {
             return false;
+        }
     }
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeModule(AstModule& module, Uint32Vector* offsets, Bytes* bytes)
 {
     Encoder e(*bytes);
 
-    if (!e.writeFixedU32(MagicNumber))
-        return false;
-
-    if (!e.writeFixedU32(EncodingVersion))
-        return false;
+    if (!e.writeFixedU32(MagicNumber)) {
+        return false;
+    }
+
+    if (!e.writeFixedU32(EncodingVersion)) {
+        return false;
+    }
 
 #ifdef ENABLE_WASM_GC
-    if (!EncodeGcFeatureOptInSection(e, module))
-        return false;
+    if (!EncodeGcFeatureOptInSection(e, module)) {
+        return false;
+    }
 #endif
 
-    if (!EncodeTypeSection(e, module))
-        return false;
-
-    if (!EncodeImportSection(e, module))
-        return false;
-
-    if (!EncodeFunctionSection(e, module))
-        return false;
-
-    if (!EncodeTableSection(e, module))
-        return false;
-
-    if (!EncodeMemorySection(e, module))
-        return false;
-
-    if (!EncodeGlobalSection(e, module))
-        return false;
-
-    if (!EncodeExportSection(e, module))
-        return false;
-
-    if (!EncodeStartSection(e, module))
-        return false;
-
-    if (!EncodeElemSection(e, module))
-        return false;
-
-    if (!EncodeCodeSection(e, offsets, module))
-        return false;
-
-    if (!EncodeDataSection(e, module))
-        return false;
+    if (!EncodeTypeSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeImportSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeFunctionSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeTableSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeMemorySection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeGlobalSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeExportSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeStartSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeElemSection(e, module)) {
+        return false;
+    }
+
+    if (!EncodeCodeSection(e, offsets, module)) {
+        return false;
+    }
+
+    if (!EncodeDataSection(e, module)) {
+        return false;
+    }
 
     return true;
 }
 
 static bool
 EncodeBinaryModule(const AstModule& module, Bytes* bytes)
 {
     Encoder e(*bytes);
@@ -6110,37 +6889,41 @@ EncodeBinaryModule(const AstModule& modu
     MOZ_ASSERT(dataSegments.length() == 1);
 
     for (const AstName& fragment : dataSegments[0]->fragments()) {
         const char16_t* cur = fragment.begin();
         const char16_t* end = fragment.end();
         while (cur != end) {
             uint8_t byte;
             MOZ_ALWAYS_TRUE(ConsumeTextByte(&cur, end, &byte));
-            if (!e.writeFixedU8(byte))
+            if (!e.writeFixedU8(byte)) {
                 return false;
+            }
         }
     }
 
     return true;
 }
 
 /*****************************************************************************/
 
 bool
 wasm::TextToBinary(const char16_t* text, uintptr_t stackLimit, Bytes* bytes, Uint32Vector* offsets,
                    UniqueChars* error)
 {
     LifoAlloc lifo(AST_LIFO_DEFAULT_CHUNK_SIZE);
 
     bool binary = false;
     AstModule* module = ParseModule(text, stackLimit, lifo, error, &binary);
-    if (!module)
-        return false;
-
-    if (binary)
+    if (!module) {
+        return false;
+    }
+
+    if (binary) {
         return EncodeBinaryModule(*module, bytes);
-
-    if (!ResolveModule(lifo, module, error))
-        return false;
+    }
+
+    if (!ResolveModule(lifo, module, error)) {
+        return false;
+    }
 
     return EncodeModule(*module, offsets, bytes);
 }
--- a/js/src/wasm/WasmTypes.cpp
+++ b/js/src/wasm/WasmTypes.cpp
@@ -92,28 +92,30 @@ Val::writePayload(uint8_t* dst) const
         memcpy(dst, &u.ptr_, sizeof(JSObject*));
         // Either the written location is in the global data section in the
         // WasmInstanceObject, or the Cell of a WasmGlobalObject:
         // - WasmInstanceObjects are always tenured and u.ptr_ may point to a
         // nursery object, so we need a post-barrier since the global data of
         // an instance is effectively a field of the WasmInstanceObject.
         // - WasmGlobalObjects are always tenured, and they have a Cell field,
         // so a post-barrier may be needed for the same reason as above.
-        if (u.ptr_)
+        if (u.ptr_) {
             JSObject::writeBarrierPost((JSObject**)dst, nullptr, u.ptr_);
+        }
         return;
     }
     MOZ_CRASH("unexpected Val type");
 }
 
 void
 Val::trace(JSTracer* trc)
 {
-    if (type_.isValid() && type_.isRefOrAnyRef() && u.ptr_)
+    if (type_.isValid() && type_.isRefOrAnyRef() && u.ptr_) {
         TraceManuallyBarrieredEdge(trc, &u.ptr_, "wasm ref/anyref global");
+    }
 }
 
 bool
 wasm::IsRoundingFunction(SymbolicAddress callee, jit::RoundingMode* mode)
 {
     switch (callee) {
       case SymbolicAddress::FloorD:
       case SymbolicAddress::FloorF:
@@ -225,25 +227,28 @@ EncodeImmediateType(ValType vt)
     MOZ_CRASH("bad ValType");
 }
 
 /* static */ bool
 FuncTypeIdDesc::isGlobal(const FuncType& funcType)
 {
     unsigned numTypes = (funcType.ret() == ExprType::Void ? 0 : 1) +
                         (funcType.args().length());
-    if (numTypes > sMaxTypes)
+    if (numTypes > sMaxTypes) {
         return true;
+    }
 
-    if (funcType.ret() != ExprType::Void && !IsImmediateType(NonVoidToValType(funcType.ret())))
+    if (funcType.ret() != ExprType::Void && !IsImmediateType(NonVoidToValType(funcType.ret()))) {
         return true;
+    }
 
     for (ValType v : funcType.args()) {
-        if (!IsImmediateType(v))
+        if (!IsImmediateType(v)) {
             return true;
+        }
     }
 
     return false;
 }
 
 /* static */ FuncTypeIdDesc
 FuncTypeIdDesc::global(const FuncType& funcType, uint32_t globalDataOffset)
 {
@@ -316,18 +321,19 @@ FuncTypeWithId::sizeOfExcludingThis(Mall
     return FuncType::sizeOfExcludingThis(mallocSizeOf);
 }
 
 // A simple notion of prefix: types and mutability must match exactly.
 
 bool
 StructType::hasPrefix(const StructType& other) const
 {
-    if (fields_.length() < other.fields_.length())
+    if (fields_.length() < other.fields_.length()) {
         return false;
+    }
     uint32_t limit = other.fields_.length();
     for (uint32_t i = 0; i < limit; i++) {
         if (fields_[i].type != other.fields_[i].type ||
             fields_[i].isMutable != other.fields_[i].isMutable)
         {
             return false;
         }
     }
@@ -502,20 +508,21 @@ wasm::IsValidARMImmediate(uint32_t i)
     return valid;
 }
 
 uint32_t
 wasm::RoundUpToNextValidARMImmediate(uint32_t i)
 {
     MOZ_ASSERT(i <= 0xff000000);
 
-    if (i <= 16 * 1024 * 1024)
+    if (i <= 16 * 1024 * 1024) {
         i = i ? mozilla::RoundUpPow2(i) : 0;
-    else
+    } else {
         i = (i + 0x00ffffff) & ~0x00ffffff;
+    }
 
     MOZ_ASSERT(IsValidARMImmediate(i));
 
     return i;
 }
 
 #ifndef WASM_HUGE_MEMORY
 
@@ -592,22 +599,24 @@ DebugFrame::environmentChain() const
     return &global()->lexicalEnvironment();
 }
 
 bool
 DebugFrame::getLocal(uint32_t localIndex, MutableHandleValue vp)
 {
     ValTypeVector locals;
     size_t argsLength;
-    if (!instance()->debug().debugGetLocalTypes(funcIndex(), &locals, &argsLength))
+    if (!instance()->debug().debugGetLocalTypes(funcIndex(), &locals, &argsLength)) {
         return false;
+    }
 
     BaseLocalIter iter(locals, argsLength, /* debugEnabled = */ true);
-    while (!iter.done() && iter.index() < localIndex)
+    while (!iter.done() && iter.index() < localIndex) {
         iter++;
+    }
     MOZ_ALWAYS_TRUE(!iter.done());
 
     uint8_t* frame = static_cast<uint8_t*>((void*)this) + offsetOfFrame();
     void* dataPtr = frame - iter.frameOffset();
     switch (iter.mirType()) {
       case jit::MIRType::Int32:
           vp.set(Int32Value(*static_cast<int32_t*>(dataPtr)));
           break;
@@ -692,78 +701,86 @@ DebugFrame::leave(JSContext* cx)
        observing_ = false;
     }
 }
 
 bool
 TrapSiteVectorArray::empty() const
 {
     for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
-        if (!(*this)[trap].empty())
+        if (!(*this)[trap].empty()) {
             return false;
+        }
     }
 
     return true;
 }
 
 void
 TrapSiteVectorArray::clear()
 {
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         (*this)[trap].clear();
+    }
 }
 
 void
 TrapSiteVectorArray::swap(TrapSiteVectorArray& rhs)
 {
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         (*this)[trap].swap(rhs[trap]);
+    }
 }
 
 void
 TrapSiteVectorArray::podResizeToFit()
 {
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         (*this)[trap].podResizeToFit();
+    }
 }
 
 size_t
 TrapSiteVectorArray::serializedSize() const
 {
     size_t ret = 0;
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         ret += SerializedPodVectorSize((*this)[trap]);
+    }
     return ret;
 }
 
 uint8_t*
 TrapSiteVectorArray::serialize(uint8_t* cursor) const
 {
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         cursor = SerializePodVector(cursor, (*this)[trap]);
+    }
     return cursor;
 }
 
 const uint8_t*
 TrapSiteVectorArray::deserialize(const uint8_t* cursor)
 {
     for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         cursor = DeserializePodVector(cursor, &(*this)[trap]);
-        if (!cursor)
+        if (!cursor) {
             return nullptr;
+        }
     }
     return cursor;
 }
 
 size_t
 TrapSiteVectorArray::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const
 {
     size_t ret = 0;
-    for (Trap trap : MakeEnumeratedRange(Trap::Limit))
+    for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         ret += (*this)[trap].sizeOfExcludingThis(mallocSizeOf);
+    }
     return ret;
 }
 
 CodeRange::CodeRange(Kind kind, Offsets offsets)
   : begin_(offsets.begin),
     ret_(0),
     end_(offsets.end),
     kind_(kind)
@@ -865,30 +882,32 @@ CodeRange::CodeRange(uint32_t funcIndex,
 
 const CodeRange*
 wasm::LookupInSorted(const CodeRangeVector& codeRanges, CodeRange::OffsetInCode target)
 {
     size_t lowerBound = 0;
     size_t upperBound = codeRanges.length();
 
     size_t match;
-    if (!BinarySearch(codeRanges, lowerBound, upperBound, target, &match))
+    if (!BinarySearch(codeRanges, lowerBound, upperBound, target, &match)) {
         return nullptr;
+    }
 
     return &codeRanges[match];
 }
 
 UniqueTlsData
 wasm::CreateTlsData(uint32_t globalDataLength)
 {
     MOZ_ASSERT(globalDataLength % gc::SystemPageSize() == 0);
 
     void* allocatedBase = js_calloc(TlsDataAlign + offsetof(TlsData, globalArea) + globalDataLength);
-    if (!allocatedBase)
+    if (!allocatedBase) {
         return nullptr;
+    }
 
     auto* tlsData = reinterpret_cast<TlsData*>(AlignBytes(uintptr_t(allocatedBase), TlsDataAlign));
     tlsData->allocatedBase = allocatedBase;
 
     return UniqueTlsData(tlsData);
 }
 
 void
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -145,18 +145,19 @@ typedef Vector<Type, 0, SystemAllocPolic
 template <class T>
 struct ShareableBase : AtomicRefCounted<T>
 {
     using SeenSet = HashSet<const T*, DefaultHasher<const T*>, SystemAllocPolicy>;
 
     size_t sizeOfIncludingThisIfNotSeen(MallocSizeOf mallocSizeOf, SeenSet* seen) const {
         const T* self = static_cast<const T*>(this);
         typename SeenSet::AddPtr p = seen->lookupForAdd(self);
-        if (p)
+        if (p) {
             return 0;
+        }
         bool ok = seen->add(p, self);
         (void)ok;  // oh well
         return mallocSizeOf(self) + self->sizeOfExcludingThis(mallocSizeOf);
     }
 };
 
 // ShareableBytes is a reference-counted Vector of bytes.
 
@@ -752,50 +753,56 @@ class FuncType
     }
 
     ValType arg(unsigned i) const { return args_[i]; }
     const ValTypeVector& args() const { return args_; }
     const ExprType& ret() const { return ret_; }
 
     HashNumber hash() const {
         HashNumber hn = HashNumber(ret_.code());
-        for (const ValType& vt : args_)
+        for (const ValType& vt : args_) {
             hn = mozilla::AddToHash(hn, HashNumber(vt.code()));
+        }
         return hn;
     }
     bool operator==(const FuncType& rhs) const {
         return ret() == rhs.ret() && EqualContainers(args(), rhs.args());
     }
     bool operator!=(const FuncType& rhs) const {
         return !(*this == rhs);
     }
 
     bool hasI64ArgOrRet() const {
-        if (ret() == ExprType::I64)
+        if (ret() == ExprType::I64) {
             return true;
+        }
         for (ValType arg : args()) {
-            if (arg == ValType::I64)
+            if (arg == ValType::I64) {
                 return true;
+            }
         }
         return false;
     }
     bool temporarilyUnsupportedAnyRef() const {
-        if (ret().isRefOrAnyRef())
+        if (ret().isRefOrAnyRef()) {
             return true;
+        }
         for (ValType arg : args()) {
-            if (arg.isRefOrAnyRef())
+            if (arg.isRefOrAnyRef()) {
                 return true;
+            }
         }
         return false;
     }
 #ifdef WASM_PRIVATE_REFTYPES
     bool exposesRef() const {
         for (const ValType& arg : args()) {
-            if (arg.isRef())
+            if (arg.isRef()) {
                 return true;
+            }
         }
         return ret().isRef();
     }
 #endif
 
     WASM_DECLARE_SERIALIZABLE(FuncType)
 };
 
@@ -1036,18 +1043,19 @@ class GlobalDesc
     }
     unsigned offset() const {
         MOZ_ASSERT(!isConstant());
         MOZ_ASSERT(u.var.offset_ != UINT32_MAX);
         return u.var.offset_;
     }
 
     void setIsExport() {
-        if (!isConstant())
+        if (!isConstant()) {
             u.var.isExport_ = true;
+        }
     }
 
     GlobalKind kind() const { return kind_; }
     bool isVariable() const { return kind_ == GlobalKind::Variable; }
     bool isConstant() const { return kind_ == GlobalKind::Constant; }
     bool isImport() const { return kind_ == GlobalKind::Import; }
 
     bool isMutable() const { return !isConstant() && u.var.isMutable_; }
@@ -1537,18 +1545,19 @@ class CodeRange
     CodeRange(Kind kind, CallableOffsets offsets);
     CodeRange(Kind kind, uint32_t funcIndex, CallableOffsets);
     CodeRange(uint32_t funcIndex, JitExitOffsets offsets);
     CodeRange(uint32_t funcIndex, uint32_t lineOrBytecode, FuncOffsets offsets);
 
     void offsetBy(uint32_t offset) {
         begin_ += offset;
         end_ += offset;
-        if (hasReturn())
+        if (hasReturn()) {
             ret_ += offset;
+        }
     }
 
     // All CodeRanges have a begin and end.
 
     uint32_t begin() const {
         return begin_;
     }
     uint32_t end() const {
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -40,59 +40,65 @@ using mozilla::Unused;
 
 bool
 Decoder::failf(const char* msg, ...)
 {
     va_list ap;
     va_start(ap, msg);
     UniqueChars str(JS_vsmprintf(msg, ap));
     va_end(ap);
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     return fail(str.get());
 }
 
 void
 Decoder::warnf(const char* msg, ...)
 {
-    if (!warnings_)
+    if (!warnings_) {
         return;
+    }
 
     va_list ap;
     va_start(ap, msg);
     UniqueChars str(JS_vsmprintf(msg, ap));
     va_end(ap);
-    if (!str)
+    if (!str) {
         return;
+    }
 
     Unused << warnings_->append(std::move(str));
 }
 
 bool
 Decoder::fail(size_t errorOffset, const char* msg)
 {
     MOZ_ASSERT(error_);
     UniqueChars strWithOffset(JS_smprintf("at offset %zu: %s", errorOffset, msg));
-    if (!strWithOffset)
+    if (!strWithOffset) {
         return false;
+    }
 
     *error_ = std::move(strWithOffset);
     return false;
 }
 
 bool
 Decoder::readSectionHeader(uint8_t* id, SectionRange* range)
 {
-    if (!readFixedU8(id))
+    if (!readFixedU8(id)) {
         return false;
+    }
 
     uint32_t size;
-    if (!readVarU32(&size))
+    if (!readVarU32(&size)) {
         return false;
+    }
 
     range->start = currentOffset();
     range->size = size;
     return true;
 }
 
 bool
 Decoder::startSection(SectionId id, ModuleEnvironment* env, MaybeSectionRange* range,
@@ -108,44 +114,49 @@ Decoder::startSection(SectionId id, Modu
 
     // Maintain a pointer to the current section that gets updated as custom
     // sections are skipped.
     const uint8_t* currentSectionStart = cur_;
 
     // Only start a section with 'id', skipping any custom sections before it.
 
     uint8_t idValue;
-    if (!readFixedU8(&idValue))
+    if (!readFixedU8(&idValue)) {
         goto rewind;
+    }
 
     while (idValue != uint8_t(id)) {
-        if (idValue != uint8_t(SectionId::Custom))
+        if (idValue != uint8_t(SectionId::Custom)) {
             goto rewind;
+        }
 
         // Rewind to the beginning of the current section since this is what
         // skipCustomSection() assumes.
         cur_ = currentSectionStart;
-        if (!skipCustomSection(env))
+        if (!skipCustomSection(env)) {
             return false;
+        }
 
         // Having successfully skipped a custom section, consider the next
         // section.
         currentSectionStart = cur_;
-        if (!readFixedU8(&idValue))
+        if (!readFixedU8(&idValue)) {
             goto rewind;
+        }
     }
 
     // Don't check the size since the range of bytes being decoded might not
     // contain the section body. (This is currently the case when streaming: the
     // code section header is decoded with the module environment bytes, the
     // body of the code section is streamed in separately.)
 
     uint32_t size;
-    if (!readVarU32(&size))
+    if (!readVarU32(&size)) {
         goto fail;
+    }
 
     range->emplace();
     (*range)->start = currentOffset();
     (*range)->size = size;
     return true;
 
   rewind:
     cur_ = initialCur;
@@ -154,20 +165,22 @@ Decoder::startSection(SectionId id, Modu
 
   fail:
     return failf("failed to start %s section", sectionName);
 }
 
 bool
 Decoder::finishSection(const SectionRange& range, const char* sectionName)
 {
-    if (resilientMode_)
+    if (resilientMode_) {
         return true;
-    if (range.size != currentOffset() - range.start)
+    }
+    if (range.size != currentOffset() - range.start) {
         return failf("byte size mismatch in %s section", sectionName);
+    }
     return true;
 }
 
 bool
 Decoder::startCustomSection(const char* expected, size_t expectedLength, ModuleEnvironment* env,
                             MaybeSectionRange* range)
 {
     // Record state at beginning of section to allow rewinding to this point
@@ -175,40 +188,46 @@ Decoder::startCustomSection(const char* 
     // section 'id'.
     const uint8_t* const initialCur = cur_;
     const size_t initialCustomSectionsLength = env->customSections.length();
 
     while (true) {
         // Try to start a custom section. If we can't, rewind to the beginning
         // since we may have skipped several custom sections already looking for
         // 'expected'.
-        if (!startSection(SectionId::Custom, env, range, "custom"))
+        if (!startSection(SectionId::Custom, env, range, "custom")) {
             return false;
-        if (!*range)
+        }
+        if (!*range) {
             goto rewind;
+        }
 
-        if (bytesRemain() < (*range)->size)
+        if (bytesRemain() < (*range)->size) {
             goto fail;
+        }
 
         NameInBytecode name;
-        if (!readVarU32(&name.length) || name.length > bytesRemain())
+        if (!readVarU32(&name.length) || name.length > bytesRemain()) {
             goto fail;
+        }
 
         name.offset = currentOffset();
         uint32_t payloadOffset = name.offset + name.length;
         uint32_t payloadEnd = (*range)->start + (*range)->size;
-        if (payloadOffset > payloadEnd)
+        if (payloadOffset > payloadEnd) {
             goto fail;
+        }
 
         // Now that we have a valid custom section, record its offsets in the
         // metadata which can be queried by the user via Module.customSections.
         // Note: after an entry is appended, it may be popped if this loop or
         // the loop in startSection needs to rewind.
-        if (!env->customSections.emplaceBack(name, payloadOffset, payloadEnd - payloadOffset))
+        if (!env->customSections.emplaceBack(name, payloadOffset, payloadEnd - payloadOffset)) {
             return false;
+        }
 
         // If this is the expected custom section, we're done.
         if (!expected || (expectedLength == name.length && !memcmp(cur_, expected, name.length))) {
             cur_ += name.length;
             return true;
         }
 
         // Otherwise, blindly skip the custom section and keep looking.
@@ -263,42 +282,47 @@ Decoder::skipAndFinishCustomSection(cons
     MOZ_ASSERT(cur_ <= end_);
     clearError();
 }
 
 bool
 Decoder::skipCustomSection(ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!startCustomSection(nullptr, 0, env, &range))
+    if (!startCustomSection(nullptr, 0, env, &range)) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return fail("expected custom section");
+    }
 
     skipAndFinishCustomSection(*range);
     return true;
 }
 
 bool
 Decoder::startNameSubsection(NameType nameType, Maybe<uint32_t>* endOffset)
 {
     MOZ_ASSERT(!*endOffset);
 
     const uint8_t* const initialPosition = cur_;
 
     uint8_t nameTypeValue;
-    if (!readFixedU8(&nameTypeValue))
+    if (!readFixedU8(&nameTypeValue)) {
         goto rewind;
+    }
 
-    if (nameTypeValue != uint8_t(nameType))
+    if (nameTypeValue != uint8_t(nameType)) {
         goto rewind;
+    }
 
     uint32_t payloadLength;
-    if (!readVarU32(&payloadLength) || payloadLength > bytesRemain())
+    if (!readVarU32(&payloadLength) || payloadLength > bytesRemain()) {
         return fail("bad name subsection payload length");
+    }
 
     *endOffset = Some(currentOffset() + payloadLength);
     return true;
 
   rewind:
     cur_ = initialPosition;
     return true;
 }
@@ -314,144 +338,163 @@ Decoder::finishNameSubsection(uint32_t e
 
     return true;
 }
 
 bool
 Decoder::skipNameSubsection()
 {
     uint8_t nameTypeValue;
-    if (!readFixedU8(&nameTypeValue))
+    if (!readFixedU8(&nameTypeValue)) {
         return fail("unable to read name subsection id");
+    }
 
     switch (nameTypeValue) {
       case uint8_t(NameType::Module):
       case uint8_t(NameType::Function):
         return fail("out of order name subsections");
       default:
         break;
     }
 
     uint32_t payloadLength;
-    if (!readVarU32(&payloadLength) || !readBytes(payloadLength))
+    if (!readVarU32(&payloadLength) || !readBytes(payloadLength)) {
         return fail("bad name subsection payload length");
+    }
 
     return true;
 }
 
 // Misc helpers.
 
 bool
 wasm::EncodeLocalEntries(Encoder& e, const ValTypeVector& locals)
 {
-    if (locals.length() > MaxLocals)
+    if (locals.length() > MaxLocals) {
         return false;
+    }
 
     uint32_t numLocalEntries = 0;
     ValType prev;
     for (ValType t : locals) {
         if (t != prev) {
             numLocalEntries++;
             prev = t;
         }
     }
 
-    if (!e.writeVarU32(numLocalEntries))
+    if (!e.writeVarU32(numLocalEntries)) {
         return false;
+    }
 
     if (numLocalEntries) {
         prev = locals[0];
         uint32_t count = 1;
         for (uint32_t i = 1; i < locals.length(); i++, count++) {
             if (prev != locals[i]) {
-                if (!e.writeVarU32(count))
+                if (!e.writeVarU32(count)) {
                     return false;
-                if (!e.writeValType(prev))
+                }
+                if (!e.writeValType(prev)) {
                     return false;
+                }
                 prev = locals[i];
                 count = 0;
             }
         }
-        if (!e.writeVarU32(count))
+        if (!e.writeVarU32(count)) {
             return false;
-        if (!e.writeValType(prev))
+        }
+        if (!e.writeValType(prev)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 DecodeValType(Decoder& d, ModuleKind kind, uint32_t numTypes, HasGcTypes gcTypesEnabled,
               ValType* type)
 {
     uint8_t uncheckedCode;
     uint32_t uncheckedRefTypeIndex;
-    if (!d.readValType(&uncheckedCode, &uncheckedRefTypeIndex))
+    if (!d.readValType(&uncheckedCode, &uncheckedRefTypeIndex)) {
         return false;
+    }
 
     switch (uncheckedCode) {
       case uint8_t(ValType::I32):
       case uint8_t(ValType::F32):
       case uint8_t(ValType::F64):
       case uint8_t(ValType::I64):
         *type = ValType(ValType::Code(uncheckedCode));
         return true;
       case uint8_t(ValType::AnyRef):
-        if (gcTypesEnabled == HasGcTypes::False)
+        if (gcTypesEnabled == HasGcTypes::False) {
             return d.fail("reference types not enabled");
+        }
         *type = ValType(ValType::Code(uncheckedCode));
         return true;
       case uint8_t(ValType::Ref): {
-        if (gcTypesEnabled == HasGcTypes::False)
+        if (gcTypesEnabled == HasGcTypes::False) {
             return d.fail("reference types not enabled");
-        if (uncheckedRefTypeIndex >= numTypes)
+        }
+        if (uncheckedRefTypeIndex >= numTypes) {
             return d.fail("ref index out of range");
+        }
         // We further validate ref types in the caller.
         *type = ValType(ValType::Code(uncheckedCode), uncheckedRefTypeIndex);
         return true;
       }
       default:
         break;
     }
     return d.fail("bad type");
 }
 
 static bool
 ValidateRefType(Decoder& d, const TypeDefVector& types, ValType type)
 {
-    if (type.isRef() && !types[type.refTypeIndex()].isStructType())
+    if (type.isRef() && !types[type.refTypeIndex()].isStructType()) {
         return d.fail("ref does not reference a struct type");
+    }
     return true;
 }
 
 bool
 wasm::DecodeLocalEntries(Decoder& d, ModuleKind kind, const TypeDefVector& types,
                          HasGcTypes gcTypesEnabled, ValTypeVector* locals)
 {
     uint32_t numLocalEntries;
-    if (!d.readVarU32(&numLocalEntries))
+    if (!d.readVarU32(&numLocalEntries)) {
         return d.fail("failed to read number of local entries");
+    }
 
     for (uint32_t i = 0; i < numLocalEntries; i++) {
         uint32_t count;
-        if (!d.readVarU32(&count))
+        if (!d.readVarU32(&count)) {
             return d.fail("failed to read local entry count");
+        }
 
-        if (MaxLocals - locals->length() < count)
+        if (MaxLocals - locals->length() < count) {
             return d.fail("too many locals");
+        }
 
         ValType type;
-        if (!DecodeValType(d, kind, types.length(), gcTypesEnabled, &type))
+        if (!DecodeValType(d, kind, types.length(), gcTypesEnabled, &type)) {
             return false;
-        if (!ValidateRefType(d, types, type))
+        }
+        if (!ValidateRefType(d, types, type)) {
             return false;
+        }
 
-        if (!locals->appendN(type, count))
+        if (!locals->appendN(type, count)) {
             return false;
+        }
     }
 
     return true;
 }
 
 bool
 wasm::DecodeValidatedLocalEntries(Decoder& d, ValTypeVector* locals)
 {
@@ -463,18 +506,19 @@ wasm::DecodeValidatedLocalEntries(Decode
         MOZ_ALWAYS_TRUE(d.readVarU32(&count));
         MOZ_ASSERT(MaxLocals - locals->length() >= count);
 
         uint8_t uncheckedCode;
         uint32_t uncheckedRefTypeIndex;
         MOZ_ALWAYS_TRUE(d.readValType(&uncheckedCode, &uncheckedRefTypeIndex));
 
         ValType type = ValType(ValType::Code(uncheckedCode), uncheckedRefTypeIndex);
-        if (!locals->appendN(type, count))
+        if (!locals->appendN(type, count)) {
             return false;
+        }
     }
 
     return true;
 }
 
 // Function body validation.
 
 struct ValidatingPolicy
@@ -488,37 +532,41 @@ typedef OpIter<ValidatingPolicy> Validat
 static bool
 DecodeFunctionBodyExprs(const ModuleEnvironment& env, const FuncType& funcType,
                         const ValTypeVector& locals,
                         ExclusiveDeferredValidationState& dvs,
                         const uint8_t* bodyEnd, Decoder* d)
 {
     ValidatingOpIter iter(env, *d, dvs);
 
-    if (!iter.readFunctionStart(funcType.ret()))
+    if (!iter.readFunctionStart(funcType.ret())) {
         return false;
+    }
 
 #define CHECK(c) if (!(c)) return false; break
 
     while (true) {
         OpBytes op;
-        if (!iter.readOp(&op))
+        if (!iter.readOp(&op)) {
             return false;
+        }
 
         Nothing nothing;
 
         switch (op.b0) {
           case uint16_t(Op::End): {
             LabelKind unusedKind;
             ExprType unusedType;
-            if (!iter.readEnd(&unusedKind, &unusedType, &nothing))
+            if (!iter.readEnd(&unusedKind, &unusedType, &nothing)) {
                 return false;
+            }
             iter.popEnd();
-            if (iter.controlStackEmpty())
+            if (iter.controlStackEmpty()) {
                 return iter.readFunctionEnd(bodyEnd);
+            }
             break;
           }
           case uint16_t(Op::Nop):
             CHECK(iter.readNop());
           case uint16_t(Op::Drop):
             CHECK(iter.readDrop());
           case uint16_t(Op::Call): {
             uint32_t unusedIndex;
@@ -882,25 +930,27 @@ DecodeFunctionBodyExprs(const ModuleEnvi
 #endif
               default:
                 return iter.unrecognizedOpcode(&op);
             }
             break;
           }
 #ifdef ENABLE_WASM_GC
           case uint16_t(Op::RefNull): {
-            if (env.gcTypesEnabled() == HasGcTypes::False)
+            if (env.gcTypesEnabled() == HasGcTypes::False) {
                 return iter.unrecognizedOpcode(&op);
+            }
             ValType unusedType;
             CHECK(iter.readRefNull(&unusedType));
             break;
           }
           case uint16_t(Op::RefIsNull): {
-            if (env.gcTypesEnabled() == HasGcTypes::False)
+            if (env.gcTypesEnabled() == HasGcTypes::False) {
                 return iter.unrecognizedOpcode(&op);
+            }
             CHECK(iter.readConversion(ValType::AnyRef, ValType::I32, &nothing));
             break;
           }
 #endif
           case uint16_t(Op::ThreadPrefix): {
 #ifdef ENABLE_WASM_THREAD_OPS
             switch (op.b1) {
               case uint16_t(ThreadOp::Wake): {
@@ -1084,41 +1134,46 @@ DecodeFunctionBodyExprs(const ModuleEnvi
 
 bool
 wasm::ValidateFunctionBody(const ModuleEnvironment& env, uint32_t funcIndex, uint32_t bodySize,
                            Decoder& d, ExclusiveDeferredValidationState& dvs)
 {
     const FuncType& funcType = *env.funcTypes[funcIndex];
 
     ValTypeVector locals;
-    if (!locals.appendAll(funcType.args()))
+    if (!locals.appendAll(funcType.args())) {
         return false;
+    }
 
     const uint8_t* bodyBegin = d.currentPosition();
 
-    if (!DecodeLocalEntries(d, ModuleKind::Wasm, env.types, env.gcTypesEnabled(), &locals))
+    if (!DecodeLocalEntries(d, ModuleKind::Wasm, env.types, env.gcTypesEnabled(), &locals)) {
         return false;
+    }
 
-    if (!DecodeFunctionBodyExprs(env, funcType, locals, dvs, bodyBegin + bodySize, &d))
+    if (!DecodeFunctionBodyExprs(env, funcType, locals, dvs, bodyBegin + bodySize, &d)) {
         return false;
+    }
 
     return true;
 }
 
 // Section macros.
 
 static bool
 DecodePreamble(Decoder& d)
 {
-    if (d.bytesRemain() > MaxModuleBytes)
+    if (d.bytesRemain() > MaxModuleBytes) {
         return d.fail("module too big");
+    }
 
     uint32_t u32;
-    if (!d.readFixedU32(&u32) || u32 != MagicNumber)
+    if (!d.readFixedU32(&u32) || u32 != MagicNumber) {
         return d.fail("failed to match magic number");
+    }
 
     if (!d.readFixedU32(&u32) || u32 != EncodingVersion) {
         return d.failf("binary version 0x%" PRIx32 " does not match expected version 0x%" PRIx32,
                        u32, EncodingVersion);
     }
 
     return true;
 }
@@ -1131,18 +1186,19 @@ enum class TypeState
     Func
 };
 
 typedef Vector<TypeState, 0, SystemAllocPolicy> TypeStateVector;
 
 static bool
 ValidateRefType(Decoder& d, TypeStateVector* typeState, ValType type)
 {
-    if (!type.isRef())
+    if (!type.isRef()) {
         return true;
+    }
 
     uint32_t refTypeIndex = type.refTypeIndex();
     switch ((*typeState)[refTypeIndex]) {
       case TypeState::None:
         (*typeState)[refTypeIndex] = TypeState::ForwardStruct;
         break;
       case TypeState::Struct:
       case TypeState::ForwardStruct:
@@ -1152,298 +1208,348 @@ ValidateRefType(Decoder& d, TypeStateVec
     }
     return true;
 }
 
 #ifdef WASM_PRIVATE_REFTYPES
 static bool
 FuncTypeIsJSCompatible(Decoder& d, const FuncType& ft)
 {
-    if (ft.exposesRef())
+    if (ft.exposesRef()) {
         return d.fail("cannot expose reference type");
+    }
     return true;
 }
 #endif
 
 static bool
 DecodeFuncType(Decoder& d, ModuleEnvironment* env, TypeStateVector* typeState, uint32_t typeIndex)
 {
     uint32_t numArgs;
-    if (!d.readVarU32(&numArgs))
+    if (!d.readVarU32(&numArgs)) {
         return d.fail("bad number of function args");
+    }
 
-    if (numArgs > MaxParams)
+    if (numArgs > MaxParams) {
         return d.fail("too many arguments in signature");
+    }
 
     ValTypeVector args;
-    if (!args.resize(numArgs))
+    if (!args.resize(numArgs)) {
         return false;
+    }
 
     for (uint32_t i = 0; i < numArgs; i++) {
-        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &args[i]))
+        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &args[i])) {
             return false;
-        if (!ValidateRefType(d, typeState, args[i]))
+        }
+        if (!ValidateRefType(d, typeState, args[i])) {
             return false;
+        }
     }
 
     uint32_t numRets;
-    if (!d.readVarU32(&numRets))
+    if (!d.readVarU32(&numRets)) {
         return d.fail("bad number of function returns");
+    }
 
-    if (numRets > 1)
+    if (numRets > 1) {
         return d.fail("too many returns in signature");
+    }
 
     ExprType result = ExprType::Void;
 
     if (numRets == 1) {
         ValType type;
-        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &type))
+        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &type)) {
             return false;
-        if (!ValidateRefType(d, typeState, type))
+        }
+        if (!ValidateRefType(d, typeState, type)) {
             return false;
+        }
 
         result = ExprType(type);
     }
 
-    if ((*typeState)[typeIndex] != TypeState::None)
+    if ((*typeState)[typeIndex] != TypeState::None) {
         return d.fail("function type entry referenced as struct");
+    }
 
     env->types[typeIndex] = TypeDef(FuncType(std::move(args), result));
     (*typeState)[typeIndex] = TypeState::Func;
 
     return true;
 }
 
 static bool
 DecodeStructType(Decoder& d, ModuleEnvironment* env, TypeStateVector* typeState, uint32_t typeIndex)
 {
-    if (env->gcTypesEnabled() == HasGcTypes::False)
+    if (env->gcTypesEnabled() == HasGcTypes::False) {
         return d.fail("Structure types not enabled");
+    }
 
     uint32_t numFields;
-    if (!d.readVarU32(&numFields))
+    if (!d.readVarU32(&numFields)) {
         return d.fail("Bad number of fields");
+    }
 
-    if (numFields > MaxStructFields)
+    if (numFields > MaxStructFields) {
         return d.fail("too many fields in structure");
+    }
 
     StructFieldVector fields;
-    if (!fields.resize(numFields))
+    if (!fields.resize(numFields)) {
         return false;
+    }
 
     // TODO (subsequent patch): lay out the fields.
 
     for (uint32_t i = 0; i < numFields; i++) {
         uint8_t flags;
-        if (!d.readFixedU8(&flags))
+        if (!d.readFixedU8(&flags)) {
             return d.fail("expected flag");
-        if ((flags & ~uint8_t(FieldFlags::AllowedMask)) != 0)
+        }
+        if ((flags & ~uint8_t(FieldFlags::AllowedMask)) != 0) {
             return d.fail("garbage flag bits");
+        }
         fields[i].isMutable = flags & uint8_t(FieldFlags::Mutable);
-        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &fields[i].type))
+        if (!DecodeValType(d, ModuleKind::Wasm, env->types.length(), env->gcTypesEnabled(), &fields[i].type)) {
             return false;
-        if (!ValidateRefType(d, typeState, fields[i].type))
+        }
+        if (!ValidateRefType(d, typeState, fields[i].type)) {
             return false;
+        }
     }
 
-    if ((*typeState)[typeIndex] != TypeState::None && (*typeState)[typeIndex] != TypeState::ForwardStruct)
+    if ((*typeState)[typeIndex] != TypeState::None && (*typeState)[typeIndex] != TypeState::ForwardStruct) {
         return d.fail("struct type entry referenced as function");
+    }
 
     env->types[typeIndex] = TypeDef(StructType(std::move(fields)));
     (*typeState)[typeIndex] = TypeState::Struct;
 
     return true;
 }
 
 #ifdef ENABLE_WASM_GC
 static bool
 DecodeGCFeatureOptInSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::GcFeatureOptIn, env, &range, "type"))
+    if (!d.startSection(SectionId::GcFeatureOptIn, env, &range, "type")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t version;
-    if (!d.readVarU32(&version))
+    if (!d.readVarU32(&version)) {
         return d.fail("expected gc feature version");
+    }
 
     // For documentation of what's in the various versions, see
     // https://github.com/lars-t-hansen/moz-gc-experiments
     //
     // When we evolve the engine to handle v2, we will continue to recognize v1
     // here if v2 is fully backwards compatible with v1.
 
-    if (version != 1)
+    if (version != 1) {
         return d.fail("unsupported version of the gc feature");
+    }
 
     env->gcFeatureOptIn = HasGcTypes::True;
     return d.finishSection(*range, "gcfeatureoptin");
 }
 #endif
 
 static bool
 DecodeTypeSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Type, env, &range, "type"))
+    if (!d.startSection(SectionId::Type, env, &range, "type")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numTypes;
-    if (!d.readVarU32(&numTypes))
+    if (!d.readVarU32(&numTypes)) {
         return d.fail("expected number of types");
+    }
 
-    if (numTypes > MaxTypes)
+    if (numTypes > MaxTypes) {
         return d.fail("too many types");
+    }
 
-    if (!env->types.resize(numTypes))
+    if (!env->types.resize(numTypes)) {
         return false;
+    }
 
     TypeStateVector typeState;
-    if (!typeState.appendN(TypeState::None, numTypes))
+    if (!typeState.appendN(TypeState::None, numTypes)) {
         return false;
+    }
 
     for (uint32_t typeIndex = 0; typeIndex < numTypes; typeIndex++) {
         uint8_t form;
-        if (!d.readFixedU8(&form))
+        if (!d.readFixedU8(&form)) {
             return d.fail("expected type form");
+        }
 
         switch (form) {
           case uint8_t(TypeCode::Func):
-            if (!DecodeFuncType(d, env, &typeState, typeIndex))
+            if (!DecodeFuncType(d, env, &typeState, typeIndex)) {
                 return false;
+            }
             break;
           case uint8_t(TypeCode::Struct):
-            if (!DecodeStructType(d, env, &typeState, typeIndex))
+            if (!DecodeStructType(d, env, &typeState, typeIndex)) {
                 return false;
+            }
             break;
           default:
             return d.fail("expected type form");
         }
     }
 
     return d.finishSection(*range, "type");
 }
 
 static UniqueChars
 DecodeName(Decoder& d)
 {
     uint32_t numBytes;
-    if (!d.readVarU32(&numBytes))
+    if (!d.readVarU32(&numBytes)) {
         return nullptr;
+    }
 
-    if (numBytes > MaxStringBytes)
+    if (numBytes > MaxStringBytes) {
         return nullptr;
+    }
 
     const uint8_t* bytes;
-    if (!d.readBytes(numBytes, &bytes))
+    if (!d.readBytes(numBytes, &bytes)) {
         return nullptr;
+    }
 
-    if (!IsValidUtf8(bytes, numBytes))
+    if (!IsValidUtf8(bytes, numBytes)) {
         return nullptr;
+    }
 
     UniqueChars name(js_pod_malloc<char>(numBytes + 1));
-    if (!name)
+    if (!name) {
         return nullptr;
+    }
 
     memcpy(name.get(), bytes, numBytes);
     name[numBytes] = '\0';
 
     return name;
 }
 
 static bool
 DecodeSignatureIndex(Decoder& d, const TypeDefVector& types, uint32_t* funcTypeIndex)
 {
-    if (!d.readVarU32(funcTypeIndex))
+    if (!d.readVarU32(funcTypeIndex)) {
         return d.fail("expected signature index");
+    }
 
-    if (*funcTypeIndex >= types.length())
+    if (*funcTypeIndex >= types.length()) {
         return d.fail("signature index out of range");
+    }
 
-    if (!types[*funcTypeIndex].isFuncType())
+    if (!types[*funcTypeIndex].isFuncType()) {
         return d.fail("signature index references non-signature");
+    }
 
     return true;
 }
 
 static bool
 DecodeLimits(Decoder& d, Limits* limits, Shareable allowShared = Shareable::False)
 {
     uint8_t flags;
-    if (!d.readFixedU8(&flags))
+    if (!d.readFixedU8(&flags)) {
         return d.fail("expected flags");
+    }
 
     uint8_t mask = allowShared == Shareable::True
                    ? uint8_t(MemoryMasks::AllowShared)
                    : uint8_t(MemoryMasks::AllowUnshared);
 
-    if (flags & ~uint8_t(mask))
+    if (flags & ~uint8_t(mask)) {
         return d.failf("unexpected bits set in flags: %" PRIu32, (flags & ~uint8_t(mask)));
+    }
 
-    if (!d.readVarU32(&limits->initial))
+    if (!d.readVarU32(&limits->initial)) {
         return d.fail("expected initial length");
+    }
 
     if (flags & uint8_t(MemoryTableFlags::HasMaximum)) {
         uint32_t maximum;
-        if (!d.readVarU32(&maximum))
+        if (!d.readVarU32(&maximum)) {
             return d.fail("expected maximum length");
+        }
 
         if (limits->initial > maximum) {
             return d.failf("memory size minimum must not be greater than maximum; "
                            "maximum length %" PRIu32 " is less than initial length %" PRIu32,
                            maximum, limits->initial);
         }
 
         limits->maximum.emplace(maximum);
     }
 
     limits->shared = Shareable::False;
 
 #ifdef ENABLE_WASM_THREAD_OPS
     if (allowShared == Shareable::True) {
-        if ((flags & uint8_t(MemoryTableFlags::IsShared)) && !(flags & uint8_t(MemoryTableFlags::HasMaximum)))
+        if ((flags & uint8_t(MemoryTableFlags::IsShared)) && !(flags & uint8_t(MemoryTableFlags::HasMaximum))) {
             return d.fail("maximum length required for shared memory");
+        }
 
         limits->shared = (flags & uint8_t(MemoryTableFlags::IsShared))
                        ? Shareable::True
                        : Shareable::False;
     }
 #endif
 
     return true;
 }
 
 static bool
 DecodeTableLimits(Decoder& d, TableDescVector* tables)
 {
     uint8_t elementType;
-    if (!d.readFixedU8(&elementType))
+    if (!d.readFixedU8(&elementType)) {
         return d.fail("expected table element type");
+    }
 
-    if (elementType != uint8_t(TypeCode::AnyFunc))
+    if (elementType != uint8_t(TypeCode::AnyFunc)) {
         return d.fail("expected 'anyfunc' element type");
+    }
 
     Limits limits;
-    if (!DecodeLimits(d, &limits))
+    if (!DecodeLimits(d, &limits)) {
         return false;
+    }
 
     // If there's a maximum, check it is in range.  The check to exclude
     // initial > maximum is carried out by the DecodeLimits call above, so
     // we don't repeat it here.
     if (limits.initial > MaxTableInitialLength ||
         ((limits.maximum.isSome() &&
           limits.maximum.value() > MaxTableMaximumLength)))
         return d.fail("too many table elements");
 
-    if (tables->length())
+    if (tables->length()) {
         return d.fail("already have default table");
+    }
 
     return tables->emplaceBack(TableKind::AnyFunction, limits);
 }
 
 static bool
 GlobalIsJSCompatible(Decoder& d, ValType type, bool isMutable)
 {
     switch (type.code()) {
@@ -1463,370 +1569,435 @@ GlobalIsJSCompatible(Decoder& d, ValType
 
     return true;
 }
 
 static bool
 DecodeGlobalType(Decoder& d, const TypeDefVector& types, HasGcTypes gcTypesEnabled, ValType* type,
                  bool* isMutable)
 {
-    if (!DecodeValType(d, ModuleKind::Wasm, types.length(), gcTypesEnabled, type))
+    if (!DecodeValType(d, ModuleKind::Wasm, types.length(), gcTypesEnabled, type)) {
         return false;
-    if (!ValidateRefType(d, types, *type))
+    }
+    if (!ValidateRefType(d, types, *type)) {
         return false;
+    }
 
     uint8_t flags;
-    if (!d.readFixedU8(&flags))
+    if (!d.readFixedU8(&flags)) {
         return d.fail("expected global flags");
+    }
 
-    if (flags & ~uint8_t(GlobalTypeImmediate::AllowedMask))
+    if (flags & ~uint8_t(GlobalTypeImmediate::AllowedMask)) {
         return d.fail("unexpected bits set in global flags");
+    }
 
     *isMutable = flags & uint8_t(GlobalTypeImmediate::IsMutable);
     return true;
 }
 
 void
 wasm::ConvertMemoryPagesToBytes(Limits* memory)
 {
     CheckedInt<uint32_t> initialBytes = memory->initial;
     initialBytes *= PageSize;
 
     static_assert(MaxMemoryInitialPages < UINT16_MAX, "multiplying by PageSize can't overflow");
     MOZ_ASSERT(initialBytes.isValid(), "can't overflow by above assertion");
 
     memory->initial = initialBytes.value();
 
-    if (!memory->maximum)
+    if (!memory->maximum) {
         return;
+    }
 
     MOZ_ASSERT(*memory->maximum <= MaxMemoryMaximumPages);
 
     CheckedInt<uint32_t> maximumBytes = *memory->maximum;
     maximumBytes *= PageSize;
 
     // Clamp the maximum memory value to UINT32_MAX; it's not semantically
     // visible since growing will fail for values greater than INT32_MAX.
     memory->maximum = Some(maximumBytes.isValid() ? maximumBytes.value() : UINT32_MAX);
 
     MOZ_ASSERT(memory->initial <= *memory->maximum);
 }
 
 static bool
 DecodeMemoryLimits(Decoder& d, ModuleEnvironment* env)
 {
-    if (env->usesMemory())
+    if (env->usesMemory()) {
         return d.fail("already have default memory");
+    }
 
     Limits memory;
-    if (!DecodeLimits(d, &memory, Shareable::True))
+    if (!DecodeLimits(d, &memory, Shareable::True)) {
         return false;
+    }
 
-    if (memory.initial > MaxMemoryInitialPages)
+    if (memory.initial > MaxMemoryInitialPages) {
         return d.fail("initial memory size too big");
+    }
 
-    if (memory.maximum && *memory.maximum > MaxMemoryMaximumPages)
+    if (memory.maximum && *memory.maximum > MaxMemoryMaximumPages) {
         return d.fail("maximum memory size too big");
+    }
 
     ConvertMemoryPagesToBytes(&memory);
 
-    if (memory.shared == Shareable::True && env->sharedMemoryEnabled == Shareable::False)
+    if (memory.shared == Shareable::True && env->sharedMemoryEnabled == Shareable::False) {
         return d.fail("shared memory is disabled");
+    }
 
     env->memoryUsage = memory.shared == Shareable::True
                      ? MemoryUsage::Shared
                      : MemoryUsage::Unshared;
     env->minMemoryLength = memory.initial;
     env->maxMemoryLength = memory.maximum;
     return true;
 }
 
 static bool
 DecodeImport(Decoder& d, ModuleEnvironment* env)
 {
     UniqueChars moduleName = DecodeName(d);
-    if (!moduleName)
+    if (!moduleName) {
         return d.fail("expected valid import module name");
+    }
 
     UniqueChars funcName = DecodeName(d);
-    if (!funcName)
+    if (!funcName) {
         return d.fail("expected valid import func name");
+    }
 
     uint8_t rawImportKind;
-    if (!d.readFixedU8(&rawImportKind))
+    if (!d.readFixedU8(&rawImportKind)) {
         return d.fail("failed to read import kind");
+    }
 
     DefinitionKind importKind = DefinitionKind(rawImportKind);
 
     switch (importKind) {
       case DefinitionKind::Function: {
         uint32_t funcTypeIndex;
-        if (!DecodeSignatureIndex(d, env->types, &funcTypeIndex))
+        if (!DecodeSignatureIndex(d, env->types, &funcTypeIndex)) {
             return false;
+        }
 #ifdef WASM_PRIVATE_REFTYPES
-        if (!FuncTypeIsJSCompatible(d, env->types[funcTypeIndex].funcType()))
+        if (!FuncTypeIsJSCompatible(d, env->types[funcTypeIndex].funcType())) {
             return false;
+        }
 #endif
-        if (!env->funcTypes.append(&env->types[funcTypeIndex].funcType()))
+        if (!env->funcTypes.append(&env->types[funcTypeIndex].funcType())) {
             return false;
-        if (env->funcTypes.length() > MaxFuncs)
+        }
+        if (env->funcTypes.length() > MaxFuncs) {
             return d.fail("too many functions");
+        }
         break;
       }
       case DefinitionKind::Table: {
-        if (!DecodeTableLimits(d, &env->tables))
+        if (!DecodeTableLimits(d, &env->tables)) {
             return false;
+        }
         env->tables.back().external = true;
 #ifdef WASM_PRIVATE_REFTYPES
         env->tables.back().importedOrExported = true;
 #endif
         break;
       }
       case DefinitionKind::Memory: {
-        if (!DecodeMemoryLimits(d, env))
+        if (!DecodeMemoryLimits(d, env)) {
             return false;
+        }
         break;
       }
       case DefinitionKind::Global: {
         ValType type;
         bool isMutable;
-        if (!DecodeGlobalType(d, env->types, env->gcTypesEnabled(), &type, &isMutable))
+        if (!DecodeGlobalType(d, env->types, env->gcTypesEnabled(), &type, &isMutable)) {
             return false;
-        if (!GlobalIsJSCompatible(d, type, isMutable))
+        }
+        if (!GlobalIsJSCompatible(d, type, isMutable)) {
             return false;
-        if (!env->globals.append(GlobalDesc(type, isMutable, env->globals.length())))
+        }
+        if (!env->globals.append(GlobalDesc(type, isMutable, env->globals.length()))) {
             return false;
-        if (env->globals.length() > MaxGlobals)
+        }
+        if (env->globals.length() > MaxGlobals) {
             return d.fail("too many globals");
+        }
         break;
       }
       default:
         return d.fail("unsupported import kind");
     }
 
     return env->imports.emplaceBack(std::move(moduleName), std::move(funcName), importKind);
 }
 
 static bool
 DecodeImportSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Import, env, &range, "import"))
+    if (!d.startSection(SectionId::Import, env, &range, "import")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numImports;
-    if (!d.readVarU32(&numImports))
+    if (!d.readVarU32(&numImports)) {
         return d.fail("failed to read number of imports");
+    }
 
-    if (numImports > MaxImports)
+    if (numImports > MaxImports) {
         return d.fail("too many imports");
+    }
 
     for (uint32_t i = 0; i < numImports; i++) {
-        if (!DecodeImport(d, env))
+        if (!DecodeImport(d, env)) {
             return false;
+        }
     }
 
-    if (!d.finishSection(*range, "import"))
+    if (!d.finishSection(*range, "import")) {
         return false;
+    }
 
     // The global data offsets will be filled in by ModuleGenerator::init.
-    if (!env->funcImportGlobalDataOffsets.resize(env->funcTypes.length()))
+    if (!env->funcImportGlobalDataOffsets.resize(env->funcTypes.length())) {
         return false;
+    }
 
     return true;
 }
 
 static bool
 DecodeFunctionSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Function, env, &range, "function"))
+    if (!d.startSection(SectionId::Function, env, &range, "function")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numDefs;
-    if (!d.readVarU32(&numDefs))
+    if (!d.readVarU32(&numDefs)) {
         return d.fail("expected number of function definitions");
+    }
 
     CheckedInt<uint32_t> numFuncs = env->funcTypes.length();
     numFuncs += numDefs;
-    if (!numFuncs.isValid() || numFuncs.value() > MaxFuncs)
+    if (!numFuncs.isValid() || numFuncs.value() > MaxFuncs) {
         return d.fail("too many functions");
+    }
 
-    if (!env->funcTypes.reserve(numFuncs.value()))
+    if (!env->funcTypes.reserve(numFuncs.value())) {
         return false;
+    }
 
     for (uint32_t i = 0; i < numDefs; i++) {
         uint32_t funcTypeIndex;
-        if (!DecodeSignatureIndex(d, env->types, &funcTypeIndex))
+        if (!DecodeSignatureIndex(d, env->types, &funcTypeIndex)) {
             return false;
+        }
         env->funcTypes.infallibleAppend(&env->types[funcTypeIndex].funcType());
     }
 
     return d.finishSection(*range, "function");
 }
 
 static bool
 DecodeTableSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Table, env, &range, "table"))
+    if (!d.startSection(SectionId::Table, env, &range, "table")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numTables;
-    if (!d.readVarU32(&numTables))
+    if (!d.readVarU32(&numTables)) {
         return d.fail("failed to read number of tables");
+    }
 
-    if (numTables > 1)
+    if (numTables > 1) {
         return d.fail("the number of tables must be at most one");
+    }
 
     for (uint32_t i = 0; i < numTables; ++i) {
-        if (!DecodeTableLimits(d, &env->tables))
+        if (!DecodeTableLimits(d, &env->tables)) {
             return false;
+        }
     }
 
     return d.finishSection(*range, "table");
 }
 
 static bool
 DecodeMemorySection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Memory, env, &range, "memory"))
+    if (!d.startSection(SectionId::Memory, env, &range, "memory")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numMemories;
-    if (!d.readVarU32(&numMemories))
+    if (!d.readVarU32(&numMemories)) {
         return d.fail("failed to read number of memories");
+    }
 
-    if (numMemories > 1)
+    if (numMemories > 1) {
         return d.fail("the number of memories must be at most one");
+    }
 
     for (uint32_t i = 0; i < numMemories; ++i) {
-        if (!DecodeMemoryLimits(d, env))
+        if (!DecodeMemoryLimits(d, env)) {
             return false;
+        }
     }
 
     return d.finishSection(*range, "memory");
 }
 
 static bool
 DecodeInitializerExpression(Decoder& d, HasGcTypes gcTypesEnabled, const GlobalDescVector& globals,
                             ValType expected, uint32_t numTypes, InitExpr* init)
 {
     OpBytes op;
-    if (!d.readOp(&op))
+    if (!d.readOp(&op)) {
         return d.fail("failed to read initializer type");
+    }
 
     switch (op.b0) {
       case uint16_t(Op::I32Const): {
         int32_t i32;
-        if (!d.readVarS32(&i32))
+        if (!d.readVarS32(&i32)) {
             return d.fail("failed to read initializer i32 expression");
+        }
         *init = InitExpr(LitVal(uint32_t(i32)));
         break;
       }
       case uint16_t(Op::I64Const): {
         int64_t i64;
-        if (!d.readVarS64(&i64))
+        if (!d.readVarS64(&i64)) {
             return d.fail("failed to read initializer i64 expression");
+        }
         *init = InitExpr(LitVal(uint64_t(i64)));
         break;
       }
       case uint16_t(Op::F32Const): {
         float f32;
-        if (!d.readFixedF32(&f32))
+        if (!d.readFixedF32(&f32)) {
             return d.fail("failed to read initializer f32 expression");
+        }
         *init = InitExpr(LitVal(f32));
         break;
       }
       case uint16_t(Op::F64Const): {
         double f64;
-        if (!d.readFixedF64(&f64))
+        if (!d.readFixedF64(&f64)) {
             return d.fail("failed to read initializer f64 expression");
+        }
         *init = InitExpr(LitVal(f64));
         break;
       }
       case uint16_t(Op::RefNull): {
-        if (gcTypesEnabled == HasGcTypes::False)
+        if (gcTypesEnabled == HasGcTypes::False) {
             return d.fail("unexpected initializer expression");
+        }
         uint8_t valType;
         uint32_t refTypeIndex;
-        if (!d.readValType(&valType, &refTypeIndex))
+        if (!d.readValType(&valType, &refTypeIndex)) {
             return false;
+        }
         if (valType == uint8_t(ValType::AnyRef)) {
             *init = InitExpr(LitVal(ValType::AnyRef, nullptr));
         } else if (valType == uint8_t(ValType::Ref)) {
-            if (refTypeIndex >= numTypes)
+            if (refTypeIndex >= numTypes) {
                 return d.fail("invalid reference type for ref.null");
+            }
             *init = InitExpr(LitVal(ValType(ValType::Ref, refTypeIndex), nullptr));
         } else {
             return d.fail("expected anyref/ref as type for ref.null");
         }
         break;
       }
       case uint16_t(Op::GetGlobal): {
         uint32_t i;
-        if (!d.readVarU32(&i))
+        if (!d.readVarU32(&i)) {
             return d.fail("failed to read get_global index in initializer expression");
-        if (i >= globals.length())
+        }
+        if (i >= globals.length()) {
             return d.fail("global index out of range in initializer expression");
-        if (!globals[i].isImport() || globals[i].isMutable())
+        }
+        if (!globals[i].isImport() || globals[i].isMutable()) {
             return d.fail("initializer expression must reference a global immutable import");
+        }
         *init = InitExpr(i, globals[i].type());
         break;
       }
       default: {
         return d.fail("unexpected initializer expression");
       }
     }
 
-    if (expected != init->type())
+    if (expected != init->type()) {
         return d.fail("type mismatch: initializer type and expected type don't match");
+    }
 
     OpBytes end;
-    if (!d.readOp(&end) || end.b0 != uint16_t(Op::End))
+    if (!d.readOp(&end) || end.b0 != uint16_t(Op::End)) {
         return d.fail("failed to read end of initializer expression");
+    }
 
     return true;
 }
 
 static bool
 DecodeGlobalSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Global, env, &range, "global"))
+    if (!d.startSection(SectionId::Global, env, &range, "global")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numDefs;
-    if (!d.readVarU32(&numDefs))
+    if (!d.readVarU32(&numDefs)) {
         return d.fail("expected number of globals");
+    }
 
     CheckedInt<uint32_t> numGlobals = env->globals.length();
     numGlobals += numDefs;
-    if (!numGlobals.isValid() || numGlobals.value() > MaxGlobals)
+    if (!numGlobals.isValid() || numGlobals.value() > MaxGlobals) {
         return d.fail("too many globals");
+    }
 
-    if (!env->globals.reserve(numGlobals.value()))
+    if (!env->globals.reserve(numGlobals.value())) {
         return false;
+    }
 
     for (uint32_t i = 0; i < numDefs; i++) {
         ValType type;
         bool isMutable;
-        if (!DecodeGlobalType(d, env->types, env->gcTypesEnabled(), &type, &isMutable))
+        if (!DecodeGlobalType(d, env->types, env->gcTypesEnabled(), &type, &isMutable)) {
             return false;
+        }
 
         InitExpr initializer;
         if (!DecodeInitializerExpression(d, env->gcTypesEnabled(), env->globals, type,
                                          env->types.length(), &initializer))
         {
             return false;
         }
 
@@ -1848,517 +2019,607 @@ DecodeExportName(Decoder& d, CStringSet*
     }
 
     CStringSet::AddPtr p = dupSet->lookupForAdd(exportName.get());
     if (p) {
         d.fail("duplicate export");
         return nullptr;
     }
 
-    if (!dupSet->add(p, exportName.get()))
+    if (!dupSet->add(p, exportName.get())) {
         return nullptr;
+    }
 
     return exportName;
 }
 
 static bool
 DecodeExport(Decoder& d, ModuleEnvironment* env, CStringSet* dupSet)
 {
     UniqueChars fieldName = DecodeExportName(d, dupSet);
-    if (!fieldName)
+    if (!fieldName) {
         return false;
+    }
 
     uint8_t exportKind;
-    if (!d.readFixedU8(&exportKind))
+    if (!d.readFixedU8(&exportKind)) {
         return d.fail("failed to read export kind");
+    }
 
     switch (DefinitionKind(exportKind)) {
       case DefinitionKind::Function: {
         uint32_t funcIndex;
-        if (!d.readVarU32(&funcIndex))
+        if (!d.readVarU32(&funcIndex)) {
             return d.fail("expected function index");
+        }
 
-        if (funcIndex >= env->numFuncs())
+        if (funcIndex >= env->numFuncs()) {
             return d.fail("exported function index out of bounds");
+        }
 #ifdef WASM_PRIVATE_REFTYPES
-        if (!FuncTypeIsJSCompatible(d, *env->funcTypes[funcIndex]))
+        if (!FuncTypeIsJSCompatible(d, *env->funcTypes[funcIndex])) {
             return false;
+        }
 #endif
 
         return env->exports.emplaceBack(std::move(fieldName), funcIndex, DefinitionKind::Function);
       }
       case DefinitionKind::Table: {
         uint32_t tableIndex;
-        if (!d.readVarU32(&tableIndex))
+        if (!d.readVarU32(&tableIndex)) {
             return d.fail("expected table index");
+        }
 
-        if (tableIndex >= env->tables.length())
+        if (tableIndex >= env->tables.length()) {
             return d.fail("exported table index out of bounds");
+        }
 
         MOZ_ASSERT(env->tables.length() == 1);
         env->tables[tableIndex].external = true;
 #ifdef WASM_PRIVATE_REFTYPES
         env->tables[tableIndex].importedOrExported = true;
 #endif
 
         return env->exports.emplaceBack(std::move(fieldName), DefinitionKind::Table);
       }
       case DefinitionKind::Memory: {
         uint32_t memoryIndex;
-        if (!d.readVarU32(&memoryIndex))
+        if (!d.readVarU32(&memoryIndex)) {
             return d.fail("expected memory index");
+        }
 
-        if (memoryIndex > 0 || !env->usesMemory())
+        if (memoryIndex > 0 || !env->usesMemory()) {
             return d.fail("exported memory index out of bounds");
+        }
 
         return env->exports.emplaceBack(std::move(fieldName), DefinitionKind::Memory);
       }
       case DefinitionKind::Global: {
         uint32_t globalIndex;
-        if (!d.readVarU32(&globalIndex))
+        if (!d.readVarU32(&globalIndex)) {
             return d.fail("expected global index");
+        }
 
-        if (globalIndex >= env->globals.length())
+        if (globalIndex >= env->globals.length()) {
             return d.fail("exported global index out of bounds");
+        }
 
         GlobalDesc* global = &env->globals[globalIndex];
         global->setIsExport();
-        if (!GlobalIsJSCompatible(d, global->type(), global->isMutable()))
+        if (!GlobalIsJSCompatible(d, global->type(), global->isMutable())) {
             return false;
+        }
 
         return env->exports.emplaceBack(std::move(fieldName), globalIndex, DefinitionKind::Global);
       }
       default:
         return d.fail("unexpected export kind");
     }
 
     MOZ_CRASH("unreachable");
 }
 
 static bool
 DecodeExportSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Export, env, &range, "export"))
+    if (!d.startSection(SectionId::Export, env, &range, "export")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     CStringSet dupSet;
 
     uint32_t numExports;
-    if (!d.readVarU32(&numExports))
+    if (!d.readVarU32(&numExports)) {
         return d.fail("failed to read number of exports");
+    }
 
-    if (numExports > MaxExports)
+    if (numExports > MaxExports) {
         return d.fail("too many exports");
+    }
 
     for (uint32_t i = 0; i < numExports; i++) {
-        if (!DecodeExport(d, env, &dupSet))
+        if (!DecodeExport(d, env, &dupSet)) {
             return false;
+        }
     }
 
     return d.finishSection(*range, "export");
 }
 
 static bool
 DecodeStartSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Start, env, &range, "start"))
+    if (!d.startSection(SectionId::Start, env, &range, "start")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t funcIndex;
-    if (!d.readVarU32(&funcIndex))
+    if (!d.readVarU32(&funcIndex)) {
         return d.fail("failed to read start func index");
+    }
 
-    if (funcIndex >= env->numFuncs())
+    if (funcIndex >= env->numFuncs()) {
         return d.fail("unknown start function");
+    }
 
     const FuncType& funcType = *env->funcTypes[funcIndex];
-    if (!IsVoid(funcType.ret()))
+    if (!IsVoid(funcType.ret())) {
         return d.fail("start function must not return anything");
+    }
 
-    if (funcType.args().length())
+    if (funcType.args().length()) {
         return d.fail("start function must be nullary");
+    }
 
     env->startFuncIndex = Some(funcIndex);
 
     return d.finishSection(*range, "start");
 }
 
 static bool
 DecodeElemSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Elem, env, &range, "elem"))
+    if (!d.startSection(SectionId::Elem, env, &range, "elem")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numSegments;
-    if (!d.readVarU32(&numSegments))
+    if (!d.readVarU32(&numSegments)) {
         return d.fail("failed to read number of elem segments");
+    }
 
-    if (numSegments > MaxElemSegments)
+    if (numSegments > MaxElemSegments) {
         return d.fail("too many elem segments");
+    }
 
     for (uint32_t i = 0; i < numSegments; i++) {
         uint32_t initializerKind;
-        if (!d.readVarU32(&initializerKind))
+        if (!d.readVarU32(&initializerKind)) {
             return d.fail("expected elem initializer-kind field");
+        }
 
         if (initializerKind != uint32_t(InitializerKind::Active) &&
             initializerKind != uint32_t(InitializerKind::Passive))
         {
             return d.fail("invalid elem initializer-kind field");
         }
 
         MOZ_ASSERT(env->tables.length() <= 1);
-        if (env->tables.length() == 0)
+        if (env->tables.length() == 0) {
             return d.fail("elem segment requires a table section");
+        }
 
         Maybe<InitExpr> offsetIfActive;
         if (initializerKind == uint32_t(InitializerKind::Active)) {
             InitExpr offset;
             if (!DecodeInitializerExpression(d, env->gcTypesEnabled(), env->globals, ValType::I32,
                                              env->types.length(), &offset))
             {
                 return false;
             }
             offsetIfActive.emplace(offset);
         }
 
         uint32_t numElems;
-        if (!d.readVarU32(&numElems))
+        if (!d.readVarU32(&numElems)) {
             return d.fail("expected segment size");
+        }
 
-        if (numElems > MaxTableInitialLength)
+        if (numElems > MaxTableInitialLength) {
             return d.fail("too many table elements");
+        }
 
         Uint32Vector elemFuncIndices;
-        if (!elemFuncIndices.resize(numElems))
+        if (!elemFuncIndices.resize(numElems)) {
             return false;
+        }
 
         for (uint32_t i = 0; i < numElems; i++) {
-            if (!d.readVarU32(&elemFuncIndices[i]))
+            if (!d.readVarU32(&elemFuncIndices[i])) {
                 return d.fail("failed to read element function index");
+            }
 
             uint32_t funcIndex = elemFuncIndices[i];
-            if (funcIndex >= env->numFuncs())
+            if (funcIndex >= env->numFuncs()) {
                 return d.fail("table element out of range");
+            }
 
             // If a table element function value is imported then the table can
             // contain functions from multiple instances and must be marked
             // external.
-            if (env->funcIsImport(funcIndex))
+            if (env->funcIsImport(funcIndex)) {
                 env->tables[0].external = true;
+            }
 
 #ifdef WASM_PRIVATE_REFTYPES
             if (env->tables[0].importedOrExported &&
                 !FuncTypeIsJSCompatible(d, *env->funcTypes[elemFuncIndices[i]]))
             {
                 return false;
             }
 #endif
         }
 
         if (!env->elemSegments.emplaceBack(0, std::move(offsetIfActive),
-                                           std::move(elemFuncIndices)))
+                                           std::move(elemFuncIndices))) {
             return false;
+        }
     }
 
     return d.finishSection(*range, "elem");
 }
 
 bool
 wasm::StartsCodeSection(const uint8_t* begin, const uint8_t* end, SectionRange* codeSection)
 {
     UniqueChars unused;
     Decoder d(begin, end, 0, &unused);
 
-    if (!DecodePreamble(d))
+    if (!DecodePreamble(d)) {
         return false;
+    }
 
     while (!d.done()) {
         uint8_t id;
         SectionRange range;
-        if (!d.readSectionHeader(&id, &range))
+        if (!d.readSectionHeader(&id, &range)) {
             return false;
+        }
 
         if (id == uint8_t(SectionId::Code)) {
             *codeSection = range;
             return true;
         }
 
-        if (!d.readBytes(range.size))
+        if (!d.readBytes(range.size)) {
             return false;
+        }
     }
 
     return false;
 }
 
 bool
 wasm::DecodeModuleEnvironment(Decoder& d, ModuleEnvironment* env)
 {
-    if (!DecodePreamble(d))
+    if (!DecodePreamble(d)) {
         return false;
+    }
 
 #ifdef ENABLE_WASM_GC
-    if (!DecodeGCFeatureOptInSection(d, env))
+    if (!DecodeGCFeatureOptInSection(d, env)) {
         return false;
+    }
     HasGcTypes gcFeatureOptIn = env->gcFeatureOptIn;
 #else
     HasGcTypes gcFeatureOptIn = HasGcTypes::False;
 #endif
 
     env->compilerEnv->computeParameters(d, gcFeatureOptIn);
 
-    if (!DecodeTypeSection(d, env))
+    if (!DecodeTypeSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeImportSection(d, env))
+    if (!DecodeImportSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeFunctionSection(d, env))
+    if (!DecodeFunctionSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeTableSection(d, env))
+    if (!DecodeTableSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeMemorySection(d, env))
+    if (!DecodeMemorySection(d, env)) {
         return false;
+    }
 
-    if (!DecodeGlobalSection(d, env))
+    if (!DecodeGlobalSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeExportSection(d, env))
+    if (!DecodeExportSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeStartSection(d, env))
+    if (!DecodeStartSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeElemSection(d, env))
+    if (!DecodeElemSection(d, env)) {
         return false;
+    }
 
-    if (!d.startSection(SectionId::Code, env, &env->codeSection, "code"))
+    if (!d.startSection(SectionId::Code, env, &env->codeSection, "code")) {
         return false;
+    }
 
-    if (env->codeSection && env->codeSection->size > MaxCodeSectionBytes)
+    if (env->codeSection && env->codeSection->size > MaxCodeSectionBytes) {
         return d.fail("code section too big");
+    }
 
     return true;
 }
 
 static bool
 DecodeFunctionBody(Decoder& d, const ModuleEnvironment& env,
                    ExclusiveDeferredValidationState& dvs, uint32_t funcIndex)
 {
     uint32_t bodySize;
-    if (!d.readVarU32(&bodySize))
+    if (!d.readVarU32(&bodySize)) {
         return d.fail("expected number of function body bytes");
+    }
 
-    if (bodySize > MaxFunctionBytes)
+    if (bodySize > MaxFunctionBytes) {
         return d.fail("function body too big");
+    }
 
-    if (d.bytesRemain() < bodySize)
+    if (d.bytesRemain() < bodySize) {
         return d.fail("function body length too big");
+    }
 
-    if (!ValidateFunctionBody(env, funcIndex, bodySize, d, dvs))
+    if (!ValidateFunctionBody(env, funcIndex, bodySize, d, dvs)) {
         return false;
+    }
 
     return true;
 }
 
 static bool
 DecodeCodeSection(Decoder& d, ModuleEnvironment* env,
                   ExclusiveDeferredValidationState& dvs)
 {
     if (!env->codeSection) {
-        if (env->numFuncDefs() != 0)
+        if (env->numFuncDefs() != 0) {
             return d.fail("expected function bodies");
+        }
         return true;
     }
 
     uint32_t numFuncDefs;
-    if (!d.readVarU32(&numFuncDefs))
+    if (!d.readVarU32(&numFuncDefs)) {
         return d.fail("expected function body count");
+    }
 
-    if (numFuncDefs != env->numFuncDefs())
+    if (numFuncDefs != env->numFuncDefs()) {
         return d.fail("function body count does not match function signature count");
+    }
 
     for (uint32_t funcDefIndex = 0; funcDefIndex < numFuncDefs; funcDefIndex++) {
-        if (!DecodeFunctionBody(d, *env, dvs, env->numFuncImports() + funcDefIndex))
+        if (!DecodeFunctionBody(d, *env, dvs, env->numFuncImports() + funcDefIndex)) {
             return false;
+        }
     }
 
     return d.finishSection(*env->codeSection, "code");
 }
 
 static bool
 DecodeDataSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startSection(SectionId::Data, env, &range, "data"))
+    if (!d.startSection(SectionId::Data, env, &range, "data")) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     uint32_t numSegments;
-    if (!d.readVarU32(&numSegments))
+    if (!d.readVarU32(&numSegments)) {
         return d.fail("failed to read number of data segments");
+    }
 
-    if (numSegments > MaxDataSegments)
+    if (numSegments > MaxDataSegments) {
         return d.fail("too many data segments");
+    }
 
     for (uint32_t i = 0; i < numSegments; i++) {
         uint32_t initializerKind;
-        if (!d.readVarU32(&initializerKind))
+        if (!d.readVarU32(&initializerKind)) {
             return d.fail("expected data initializer-kind field");
+        }
 
         if (initializerKind != uint32_t(InitializerKind::Active) &&
             initializerKind != uint32_t(InitializerKind::Passive))
         {
             return d.fail("invalid data initializer-kind field");
         }
 
-        if (!env->usesMemory())
+        if (!env->usesMemory()) {
             return d.fail("data segment requires a memory section");
+        }
 
         DataSegment seg;
         if (initializerKind == uint32_t(InitializerKind::Active)) {
             InitExpr segOffset;
             if (!DecodeInitializerExpression(d, env->gcTypesEnabled(), env->globals, ValType::I32,
                                              env->types.length(), &segOffset))
             {
                 return false;
             }
             seg.offsetIfActive.emplace(segOffset);
         }
 
-        if (!d.readVarU32(&seg.length))
+        if (!d.readVarU32(&seg.length)) {
             return d.fail("expected segment size");
+        }
 
-        if (seg.length > MaxMemoryInitialPages * PageSize)
+        if (seg.length > MaxMemoryInitialPages * PageSize) {
             return d.fail("segment size too big");
+        }
 
         seg.bytecodeOffset = d.currentOffset();
 
-        if (!d.readBytes(seg.length))
+        if (!d.readBytes(seg.length)) {
             return d.fail("data segment shorter than declared");
+        }
 
-        if (!env->dataSegments.append(seg))
+        if (!env->dataSegments.append(seg)) {
             return false;
+        }
     }
 
     return d.finishSection(*range, "data");
 }
 
 static bool
 DecodeModuleNameSubsection(Decoder& d, ModuleEnvironment* env)
 {
     Maybe<uint32_t> endOffset;
-    if (!d.startNameSubsection(NameType::Module, &endOffset))
+    if (!d.startNameSubsection(NameType::Module, &endOffset)) {
         return false;
-    if (!endOffset)
+    }
+    if (!endOffset) {
         return true;
+    }
 
     // Don't use NameInBytecode for module name; instead store a copy of the
     // string. This way supplying a module name doesn't need to save the whole
     // bytecode. While function names are likely to be stripped in practice,
     // module names aren't necessarily.
 
     uint32_t nameLength;
-    if (!d.readVarU32(&nameLength))
+    if (!d.readVarU32(&nameLength)) {
         return d.fail("failed to read module name length");
+    }
 
     NameInBytecode moduleName(d.currentOffset(), nameLength);
 
     const uint8_t* bytes;
-    if (!d.readBytes(nameLength, &bytes))
+    if (!d.readBytes(nameLength, &bytes)) {
         return d.fail("failed to read module name bytes");
+    }
 
     env->moduleName.emplace(moduleName);
 
     return d.finishNameSubsection(*endOffset);
 }
 
 static bool
 DecodeFunctionNameSubsection(Decoder& d, ModuleEnvironment* env)
 {
     Maybe<uint32_t> endOffset;
-    if (!d.startNameSubsection(NameType::Function, &endOffset))
+    if (!d.startNameSubsection(NameType::Function, &endOffset)) {
         return false;
-    if (!endOffset)
+    }
+    if (!endOffset) {
         return true;
+    }
 
     uint32_t nameCount = 0;
-    if (!d.readVarU32(&nameCount) || nameCount > MaxFuncs)
+    if (!d.readVarU32(&nameCount) || nameCount > MaxFuncs) {
         return d.fail("bad function name count");
+    }
 
     NameInBytecodeVector funcNames;
 
     for (uint32_t i = 0; i < nameCount; ++i) {
         uint32_t funcIndex = 0;
-        if (!d.readVarU32(&funcIndex))
+        if (!d.readVarU32(&funcIndex)) {
             return d.fail("unable to read function index");
+        }
 
         // Names must refer to real functions and be given in ascending order.
-        if (funcIndex >= env->numFuncs() || funcIndex < funcNames.length())
+        if (funcIndex >= env->numFuncs() || funcIndex < funcNames.length()) {
             return d.fail("invalid function index");
+        }
 
         uint32_t nameLength = 0;
-        if (!d.readVarU32(&nameLength) || nameLength > MaxStringLength)
+        if (!d.readVarU32(&nameLength) || nameLength > MaxStringLength) {
             return d.fail("unable to read function name length");
+        }
 
-        if (!nameLength)
+        if (!nameLength) {
             continue;
+        }
 
-        if (!funcNames.resize(funcIndex + 1))
+        if (!funcNames.resize(funcIndex + 1)) {
             return false;
+        }
 
         NameInBytecode funcName(d.currentOffset(), nameLength);
 
-        if (!d.readBytes(nameLength))
+        if (!d.readBytes(nameLength)) {
             return d.fail("unable to read function name bytes");
+        }
 
         funcNames[funcIndex] = funcName;
     }
 
-    if (!d.finishNameSubsection(*endOffset))
+    if (!d.finishNameSubsection(*endOffset)) {
         return false;
+    }
 
     // To encourage fully valid function names subsections; only save names if
     // the entire subsection decoded correctly.
     env->funcNames = std::move(funcNames);
     return true;
 }
 
 static bool
 DecodeNameSection(Decoder& d, ModuleEnvironment* env)
 {
     MaybeSectionRange range;
-    if (!d.startCustomSection(NameSectionName, env, &range))
+    if (!d.startCustomSection(NameSectionName, env, &range)) {
         return false;
-    if (!range)
+    }
+    if (!range) {
         return true;
+    }
 
     // Once started, custom sections do not report validation errors.
 
-    if (!DecodeModuleNameSubsection(d, env))
+    if (!DecodeModuleNameSubsection(d, env)) {
         goto finish;
+    }
 
-    if (!DecodeFunctionNameSubsection(d, env))
+    if (!DecodeFunctionNameSubsection(d, env)) {
         goto finish;
+    }
 
     while (d.currentOffset() < range->end()) {
-        if (!d.skipNameSubsection())
+        if (!d.skipNameSubsection()) {
             goto finish;
+        }
     }
 
   finish:
     d.finishCustomSection(NameSectionName, *range);
     return true;
 }
 
 void
@@ -2390,21 +2651,23 @@ DeferredValidationState::performDeferred
     }
 
     return true;
 }
 
 bool
 wasm::DecodeModuleTail(Decoder& d, ModuleEnvironment* env, ExclusiveDeferredValidationState& dvs)
 {
-    if (!DecodeDataSection(d, env))
+    if (!DecodeDataSection(d, env)) {
         return false;
+    }
 
-    if (!DecodeNameSection(d, env))
+    if (!DecodeNameSection(d, env)) {
         return false;
+    }
 
     while (!d.done()) {
         if (!d.skipCustomSection(env)) {
             if (d.resilientMode()) {
                 d.clearError();
                 return true;
             }
             return false;
@@ -2429,22 +2692,25 @@ wasm::Validate(JSContext* cx, const Shar
 
     CompilerEnvironment compilerEnv(CompileMode::Once, Tier::Ion, DebugEnabled::False,
                                     gcTypesConfigured);
     ModuleEnvironment env(gcTypesConfigured,
                           &compilerEnv,
                           cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled()
                           ? Shareable::True
                           : Shareable::False);
-    if (!DecodeModuleEnvironment(d, &env))
+    if (!DecodeModuleEnvironment(d, &env)) {
         return false;
+    }
 
     ExclusiveDeferredValidationState dvs(mutexid::WasmDeferredValidation);
 
-    if (!DecodeCodeSection(d, &env, dvs))
+    if (!DecodeCodeSection(d, &env, dvs)) {
         return false;
+    }
 
-    if (!DecodeModuleTail(d, &env, dvs))
+    if (!DecodeModuleTail(d, &env, dvs)) {
         return false;
+    }
 
     MOZ_ASSERT(!*error, "unreported error in decoding");
     return true;
 }
--- a/js/src/wasm/WasmValidate.h
+++ b/js/src/wasm/WasmValidate.h
@@ -255,35 +255,39 @@ class Encoder
         return bytes_.append(reinterpret_cast<const uint8_t*>(&v), sizeof(T));
     }
 
     template <typename UInt>
     MOZ_MUST_USE bool writeVarU(UInt i) {
         do {
             uint8_t byte = i & 0x7f;
             i >>= 7;
-            if (i != 0)
+            if (i != 0) {
                 byte |= 0x80;
-            if (!bytes_.append(byte))
+            }
+            if (!bytes_.append(byte)) {
                 return false;
+            }
         } while (i != 0);
         return true;
     }
 
     template <typename SInt>
     MOZ_MUST_USE bool writeVarS(SInt i) {
         bool done;
         do {
             uint8_t byte = i & 0x7f;
             i >>= 7;
             done = ((i == 0) && !(byte & 0x40)) || ((i == -1) && (byte & 0x40));
-            if (!done)
+            if (!done) {
                 byte |= 0x80;
-            if (!bytes_.append(byte))
+            }
+            if (!bytes_.append(byte)) {
                 return false;
+            }
         } while (!done);
         return true;
     }
 
     void patchVarU32(size_t offset, uint32_t patchBits, uint32_t assertBits) {
         do {
             uint8_t assertByte = assertBits & 0x7f;
             uint8_t patchByte = patchBits & 0x7f;
@@ -306,18 +310,19 @@ class Encoder
 
     void patchFixedU8(size_t offset, uint8_t patchBits, uint8_t assertBits) {
         MOZ_ASSERT(bytes_[offset] == assertBits);
         bytes_[offset] = patchBits;
     }
 
     uint32_t varU32ByteLength(size_t offset) const {
         size_t start = offset;
-        while (bytes_[offset] & 0x80)
+        while (bytes_[offset] & 0x80) {
             offset++;
+        }
         return offset - start + 1;
     }
 
   public:
     explicit Encoder(Bytes& bytes)
       : bytes_(bytes)
     {
         MOZ_ASSERT(empty());
@@ -496,18 +501,19 @@ class Decoder
     const uint8_t* cur_;
     const size_t offsetInModule_;
     UniqueChars* error_;
     UniqueCharsVector* warnings_;
     bool resilientMode_;
 
     template <class T>
     MOZ_MUST_USE bool read(T* out) {
-        if (bytesRemain() < sizeof(T))
+        if (bytesRemain() < sizeof(T)) {
             return false;
+        }
         memcpy((void*)out, cur_, sizeof(T));
         cur_ += sizeof(T);
         return true;
     }
 
     template <class T>
     T uncheckedRead() {
         MOZ_ASSERT(bytesRemain() >= sizeof(T));
@@ -529,58 +535,64 @@ class Decoder
         DebugOnly<const uint8_t*> before = cur_;
         const unsigned numBits = sizeof(UInt) * CHAR_BIT;
         const unsigned remainderBits = numBits % 7;
         const unsigned numBitsInSevens = numBits - remainderBits;
         UInt u = 0;
         uint8_t byte;
         UInt shift = 0;
         do {
-            if (!readFixedU8(&byte))
+            if (!readFixedU8(&byte)) {
                 return false;
+            }
             if (!(byte & 0x80)) {
                 *out = u | UInt(byte) << shift;
                 return true;
             }
             u |= UInt(byte & 0x7F) << shift;
             shift += 7;
         } while (shift != numBitsInSevens);
-        if (!readFixedU8(&byte) || (byte & (unsigned(-1) << remainderBits)))
+        if (!readFixedU8(&byte) || (byte & (unsigned(-1) << remainderBits))) {
             return false;
+        }
         *out = u | (UInt(byte) << numBitsInSevens);
         MOZ_ASSERT_IF(sizeof(UInt) == 4, unsigned(cur_ - before) <= MaxVarU32DecodedBytes);
         return true;
     }
 
     template <typename SInt>
     MOZ_MUST_USE bool readVarS(SInt* out) {
         using UInt = typename mozilla::MakeUnsigned<SInt>::Type;
         const unsigned numBits = sizeof(SInt) * CHAR_BIT;
         const unsigned remainderBits = numBits % 7;
         const unsigned numBitsInSevens = numBits - remainderBits;
         SInt s = 0;
         uint8_t byte;
         unsigned shift = 0;
         do {
-            if (!readFixedU8(&byte))
+            if (!readFixedU8(&byte)) {
                 return false;
+            }
             s |= SInt(byte & 0x7f) << shift;
             shift += 7;
             if (!(byte & 0x80)) {
-                if (byte & 0x40)
+                if (byte & 0x40) {
                     s |= UInt(-1) << shift;
+                }
                 *out = s;
                 return true;
             }
         } while (shift < numBitsInSevens);
-        if (!remainderBits || !readFixedU8(&byte) || (byte & 0x80))
+        if (!remainderBits || !readFixedU8(&byte) || (byte & 0x80)) {
             return false;
+        }
         uint8_t mask = 0x7f & (uint8_t(-1) << remainderBits);
-        if ((byte & mask) != ((byte & (1 << (remainderBits - 1))) ? mask : 0))
+        if ((byte & mask) != ((byte & (1 << (remainderBits - 1))) ? mask : 0)) {
             return false;
+        }
         *out = s | UInt(byte) << shift;
         return true;
     }
 
   public:
     Decoder(const uint8_t* begin, const uint8_t* end, size_t offsetInModule, UniqueChars* error,
             UniqueCharsVector* warnings = nullptr, bool resilientMode = false)
       : beg_(begin),
@@ -610,18 +622,19 @@ class Decoder
     void warnf(const char* msg, ...) MOZ_FORMAT_PRINTF(2, 3);
 
     // Report an error at the given offset (relative to the whole module).
     bool fail(size_t errorOffset, const char* msg);
 
     UniqueChars* error() { return error_; }
 
     void clearError() {
-        if (error_)
+        if (error_) {
             error_->reset();
+        }
     }
 
     bool done() const {
         MOZ_ASSERT(cur_ <= end_);
         return cur_ == end_;
     }
     bool resilientMode() const {
         return resilientMode_;
@@ -675,61 +688,69 @@ class Decoder
     MOZ_MUST_USE bool readVarU64(uint64_t* out) {
         return readVarU<uint64_t>(out);
     }
     MOZ_MUST_USE bool readVarS64(int64_t* out) {
         return readVarS<int64_t>(out);
     }
     MOZ_MUST_USE bool readValType(uint8_t* code, uint32_t* refTypeIndex) {
         static_assert(uint8_t(TypeCode::Limit) <= UINT8_MAX, "fits");
-        if (!readFixedU8(code))
+        if (!readFixedU8(code)) {
             return false;
+        }
         if (*code == uint8_t(TypeCode::Ref)) {
-            if (!readVarU32(refTypeIndex))
+            if (!readVarU32(refTypeIndex)) {
                 return false;
+            }
         } else {
             *refTypeIndex = NoRefTypeIndex;
         }
         return true;
     }
     MOZ_MUST_USE bool readBlockType(uint8_t* code, uint32_t* refTypeIndex) {
         static_assert(size_t(TypeCode::Limit) <= UINT8_MAX, "fits");
-        if (!readFixedU8(code))
+        if (!readFixedU8(code)) {
             return false;
+        }
         if (*code == uint8_t(TypeCode::Ref)) {
-            if (!readVarU32(refTypeIndex))
+            if (!readVarU32(refTypeIndex)) {
                 return false;
+            }
         } else {
             *refTypeIndex = NoRefTypeIndex;
         }
         return true;
     }
     MOZ_MUST_USE bool readOp(OpBytes* op) {
         static_assert(size_t(Op::Limit) == 256, "fits");
         uint8_t u8;
-        if (!readFixedU8(&u8))
+        if (!readFixedU8(&u8)) {
             return false;
+        }
         op->b0 = u8;
-        if (MOZ_LIKELY(!IsPrefixByte(u8)))
+        if (MOZ_LIKELY(!IsPrefixByte(u8))) {
             return true;
+        }
         if (!readFixedU8(&u8)) {
             op->b1 = 0;         // Make it sane
             return false;
         }
         op->b1 = u8;
         return true;
     }
 
     // See writeBytes comment.
 
     MOZ_MUST_USE bool readBytes(uint32_t numBytes, const uint8_t** bytes = nullptr) {
-        if (bytes)
+        if (bytes) {
             *bytes = cur_;
-        if (bytesRemain() < numBytes)
+        }
+        if (bytesRemain() < numBytes) {
             return false;
+        }
         cur_ += numBytes;
         return true;
     }
 
     // See "section" description in Encoder.
 
     MOZ_MUST_USE bool readSectionHeader(uint8_t* id, SectionRange* range);
 
@@ -788,18 +809,19 @@ class Decoder
     UInt uncheckedReadVarU() {
         static const unsigned numBits = sizeof(UInt) * CHAR_BIT;
         static const unsigned remainderBits = numBits % 7;
         static const unsigned numBitsInSevens = numBits - remainderBits;
         UInt decoded = 0;
         uint32_t shift = 0;
         do {
             uint8_t byte = *cur_++;
-            if (!(byte & 0x80))
+            if (!(byte & 0x80)) {
                 return decoded | (UInt(byte) << shift);
+            }
             decoded |= UInt(byte & 0x7f) << shift;
             shift += 7;
         } while (shift != numBitsInSevens);
         uint8_t byte = *cur_++;
         MOZ_ASSERT(!(byte & 0xf0));
         return decoded | (UInt(byte) << numBitsInSevens);
     }
     uint32_t uncheckedReadVarU32() {