Flattens Memory and Table types and backfills Table encoder (#356)
This flattens Memory and Table types, particularly making it a compilation error to add multiple of either. This also backfills binary encoding of Table. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -58,9 +58,15 @@ func (m *Module) SectionElementCount(sectionID SectionID) uint32 { // element as
|
||||
case SectionIDFunction:
|
||||
return uint32(len(m.FunctionSection))
|
||||
case SectionIDTable:
|
||||
return uint32(len(m.TableSection))
|
||||
if m.TableSection != nil {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
case SectionIDMemory:
|
||||
return uint32(len(m.MemorySection))
|
||||
if m.MemorySection != nil {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
case SectionIDGlobal:
|
||||
return uint32(len(m.GlobalSection))
|
||||
case SectionIDExport:
|
||||
|
||||
Reference in New Issue
Block a user