Updates Spectest to the latest (May 23, 2023) (#1490)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2023-05-23 15:09:36 +10:00
committed by GitHub
parent 50723a0fd2
commit 4aca6fbd0e
126 changed files with 755 additions and 1537 deletions

View File

@@ -213,10 +213,19 @@ func (m *ModuleInstance) applyElements(elems []ElementSegment) {
references[offset+uint32(i)] = Reference(0)
}
} else {
for i, fnIndex := range elem.Init {
if fnIndex != ElementInitNullReference {
references[offset+uint32(i)] = m.Engine.FunctionInstanceReference(fnIndex)
for i, init := range elem.Init {
if init == ElementInitNullReference {
continue
}
var ref Reference
if index, ok := unwrapElementInitGlobalReference(init); ok {
global := m.Globals[index]
ref = Reference(global.Val)
} else {
ref = m.Engine.FunctionInstanceReference(index)
}
references[offset+uint32(i)] = ref
}
}
}