Update the spec reference testsuite submodule (#3450)
* Update the spec reference testsuite submodule This commit brings in recent updates to the spec test suite. Most of the changes here were already fixed in `wasmparser` with some tweaks to esoteric modules, but Wasmtime also gets a bug fix where where import matching for the size of tables/memories is based on the current runtime size of the table/memory rather than the original type of the table/memory. This means that during type matching the actual value is consulted for its size rather than using the minimum size listed in its type. * Fix now-missing directories in build script
This commit is contained in:
@@ -442,12 +442,12 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||
}
|
||||
Operator::BrIf { relative_depth } => translate_br_if(*relative_depth, builder, state),
|
||||
Operator::BrTable { table } => {
|
||||
let mut depths = table.targets().collect::<Result<Vec<_>, _>>()?;
|
||||
let default = depths.pop().unwrap().0;
|
||||
let default = table.default();
|
||||
let mut min_depth = default;
|
||||
for (depth, _) in depths.iter() {
|
||||
if *depth < min_depth {
|
||||
min_depth = *depth;
|
||||
for depth in table.targets() {
|
||||
let depth = depth?;
|
||||
if depth < min_depth {
|
||||
min_depth = depth;
|
||||
}
|
||||
}
|
||||
let jump_args_count = {
|
||||
@@ -460,12 +460,13 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||
}
|
||||
};
|
||||
let val = state.pop1();
|
||||
let mut data = JumpTableData::with_capacity(depths.len());
|
||||
let mut data = JumpTableData::with_capacity(table.len() as usize);
|
||||
if jump_args_count == 0 {
|
||||
// No jump arguments
|
||||
for (depth, _) in depths.iter() {
|
||||
for depth in table.targets() {
|
||||
let depth = depth?;
|
||||
let block = {
|
||||
let i = state.control_stack.len() - 1 - (*depth as usize);
|
||||
let i = state.control_stack.len() - 1 - (depth as usize);
|
||||
let frame = &mut state.control_stack[i];
|
||||
frame.set_branched_to_exit();
|
||||
frame.br_destination()
|
||||
@@ -486,12 +487,13 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||
let return_count = jump_args_count;
|
||||
let mut dest_block_sequence = vec![];
|
||||
let mut dest_block_map = HashMap::new();
|
||||
for (depth, _) in depths.iter() {
|
||||
let branch_block = match dest_block_map.entry(*depth as usize) {
|
||||
for depth in table.targets() {
|
||||
let depth = depth?;
|
||||
let branch_block = match dest_block_map.entry(depth as usize) {
|
||||
hash_map::Entry::Occupied(entry) => *entry.get(),
|
||||
hash_map::Entry::Vacant(entry) => {
|
||||
let block = builder.create_block();
|
||||
dest_block_sequence.push((*depth as usize, block));
|
||||
dest_block_sequence.push((depth as usize, block));
|
||||
*entry.insert(block)
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user