A table is an array of function references, the substrate for indirect calls. Today you decode the table section and allocate the table's slots.
Decode the table section into a table of the declared size, with funcref slots.
A table (section id 4) is an array whose elements are function references - in the MVP, the only element type is funcref (0x70). Its purpose is indirect calls: where call names a fixed function at decode time, a table lets a program pick a function at run time by index, which is how compilers implement function pointers, virtual method dispatch, and switch-over-callbacks. Today you just decode the declaration and allocate the slots; filling and calling through them are the next lessons.
The declaration is an element type followed by limits, the same min/max shape a memory uses (you will meet it again in chapter seven). A flag byte chooses the form: 0x00 means a minimum only, 0x01 means a minimum then a maximum. So 70 00 02 is “a funcref table with at least 2 slots, no maximum”. Allocate the table at its minimum size with every slot empty - no function assigned yet - and mark empties clearly, because calling through an unfilled slot is a trap you will implement two lessons from now. The element section fills these slots next.
// A table is: elemtype (0x70 = funcref), then limits. Limits are a flag byte// (0x00 min-only, 0x01 min+max) followed by the min (and max if present).type Table struct { Funcs []int } // -1 (or a null marker) means empty slotfunc readTable(c *Cursor) (Table, error) {// read 0x70; read limits; allocate min slots, all empty}