[WebAssembly] Address review comments from r346248 [NFC]

llvm-svn: 346249
This commit is contained in:
Derek Schuff 2018-11-06 18:02:39 +00:00
parent 3bea8bcae5
commit 786760a9f6
1 changed files with 4 additions and 3 deletions

View File

@ -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<unsigned>(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");