Updates Spectest to the latest (May 23, 2023) (#1490)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user