[WebAssembly] Don't set a maximum size when importing the table
authorSam Clegg <sbc@chromium.org>
Mon, 3 Dec 2018 22:37:55 +0000 (22:37 +0000)
committerSam Clegg <sbc@chromium.org>
Mon, 3 Dec 2018 22:37:55 +0000 (22:37 +0000)
We shouldn't be setting setting a max size for a table that is
being imported.

Differential Revision: https://reviews.llvm.org/D55231

llvm-svn: 348204

lld/test/wasm/import-table.test
lld/test/wasm/shared.ll
lld/wasm/Writer.cpp

index eb76709..ae42311 100644 (file)
@@ -12,7 +12,5 @@
 # CHECK-NEXT:        Table:
 # CHECK-NEXT:          ElemType:        ANYFUNC
 # CHECK-NEXT:          Limits:
-# CHECK-NEXT:            Flags:           [ HAS_MAX ]
 # CHECK-NEXT:            Initial:         0x00000001
-# CHECK-NEXT:            Maximum:         0x00000001
 
index 81aa285..088c650 100644 (file)
@@ -44,9 +44,7 @@ declare void @func_external()
 ; CHECK-NEXT:         Table:
 ; CHECK-NEXT:           ElemType:        ANYFUNC
 ; CHECK-NEXT:           Limits:
-; CHECK-NEXT:             Flags:           [ HAS_MAX ]
 ; CHECK-NEXT:             Initial:         0x00000002
-; CHECK-NEXT:             Maximum:         0x00000002
 ; CHECK-NEXT:       - Module:          env
 ; CHECK-NEXT:         Field:           __stack_pointer
 ; CHECK-NEXT:         Kind:            GLOBAL
index a755a0d..5abfabd 100644 (file)
@@ -172,7 +172,7 @@ void Writer::createImportSection() {
     Import.Field = kFunctionTableName;
     Import.Kind = WASM_EXTERNAL_TABLE;
     Import.Table.ElemType = WASM_TYPE_ANYFUNC;
-    Import.Table.Limits = {WASM_LIMITS_FLAG_HAS_MAX, TableSize, TableSize};
+    Import.Table.Limits = {0, TableSize, 0};
     writeImport(OS, Import);
   }