Define a "table" concept.
"Table" is to WebAssembly tables as "Heap" is to WebAssembly linear memories.
This commit is contained in:
@@ -349,6 +349,9 @@ impl<'a> Verifier<'a> {
|
||||
HeapAddr { heap, .. } => {
|
||||
self.verify_heap(inst, heap)?;
|
||||
}
|
||||
TableAddr { table, .. } => {
|
||||
self.verify_table(inst, table)?;
|
||||
}
|
||||
RegSpill { dst, .. } => {
|
||||
self.verify_stack_slot(inst, dst)?;
|
||||
}
|
||||
@@ -445,6 +448,14 @@ impl<'a> Verifier<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_table(&self, inst: Inst, table: ir::Table) -> VerifierResult<()> {
|
||||
if !self.func.tables.is_valid(table) {
|
||||
err!(inst, "invalid table {}", table)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_value_list(&self, inst: Inst, l: &ValueList) -> VerifierResult<()> {
|
||||
if !l.is_valid(&self.func.dfg.value_lists) {
|
||||
err!(inst, "invalid value list reference {:?}", l)
|
||||
|
||||
Reference in New Issue
Block a user