From 786760a9f6e6f92088aeafae5f06de092e9fc4df Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 6 Nov 2018 18:02:39 +0000 Subject: [PATCH] [WebAssembly] Address review comments from r346248 [NFC] llvm-svn: 346249 --- lld/wasm/Writer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 53b9ff5b4ba4..c26ae53311b5 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -155,9 +155,8 @@ void Writer::createImportSection() { Import.Memory.Flags |= WASM_LIMITS_FLAG_HAS_MAX; Import.Memory.Maximum = MaxMemoryPages; } - if (Config->SharedMemory) { + if (Config->SharedMemory) Import.Memory.Flags |= WASM_LIMITS_FLAG_IS_SHARED; - } writeImport(OS, Import); } @@ -217,7 +216,9 @@ void Writer::createMemorySection() { bool HasMax = MaxMemoryPages != 0; writeUleb128(OS, 1, "memory count"); - unsigned Flags = HasMax ? static_cast(WASM_LIMITS_FLAG_HAS_MAX) : 0; + unsigned Flags = 0; + if (HasMax) + Flags |= WASM_LIMITS_FLAG_HAS_MAX; if (Config->SharedMemory) Flags |= WASM_LIMITS_FLAG_IS_SHARED; writeUleb128(OS, Flags, "memory limits flags");