Browse Source

Fix CI for `main` (#4486)

* Skip new `table_ops` test under emulation

When emulating we already have to disable most pooling-allocator related
tests so this commit carries over that logic to the new fuzz test which
may run some configurations with the pooling allocator depending on the
random input.

* Fix panics in s390x codegen related to aliases

This commit fixes an issue introduced as part of the fix for
GHSA-5fhj-g3p3-pq9g. The `reftyped_vregs` list given to `regalloc2` is
not allowed to have duplicates in it and while the list originally
doesn't have duplicates once aliases are applied the list may have
duplicates. The fix here is to perform another pass to remove duplicates
after the aliases have been processed.
pull/4483/head
Alex Crichton 2 years ago
committed by GitHub
parent
commit
2127c3a369
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cranelift/codegen/src/machinst/vcode.rs
  2. 6
      crates/fuzzing/src/oracles.rs

5
cranelift/codegen/src/machinst/vcode.rs

@ -603,9 +603,14 @@ impl<I: VCodeInst> VCodeBuilder<I> {
// will be returned directly to `regalloc2` eventually and all // will be returned directly to `regalloc2` eventually and all
// operands/results of instructions will use the alias-resolved vregs // operands/results of instructions will use the alias-resolved vregs
// from `regalloc2`'s perspective. // from `regalloc2`'s perspective.
//
// Also note that `reftyped_vregs` can't have duplicates, so after the
// aliases are applied duplicates are removed.
for reg in self.vcode.reftyped_vregs.iter_mut() { for reg in self.vcode.reftyped_vregs.iter_mut() {
*reg = Self::resolve_vreg_alias_impl(&self.vcode.vreg_aliases, *reg); *reg = Self::resolve_vreg_alias_impl(&self.vcode.vreg_aliases, *reg);
} }
self.vcode.reftyped_vregs.sort();
self.vcode.reftyped_vregs.dedup();
self.compute_preds_from_succs(); self.compute_preds_from_succs();
self.vcode.debug_value_labels.sort_unstable(); self.vcode.debug_value_labels.sort_unstable();

6
crates/fuzzing/src/oracles.rs

@ -716,6 +716,12 @@ fn table_ops_eventually_gcs() {
use arbitrary::Unstructured; use arbitrary::Unstructured;
use rand::prelude::*; use rand::prelude::*;
// Skip if we're under emulation because some fuzz configurations will do
// large address space reservations that QEMU doesn't handle well.
if std::env::var("WASMTIME_TEST_NO_HOG_MEMORY").is_ok() {
return;
}
let mut rng = SmallRng::seed_from_u64(0); let mut rng = SmallRng::seed_from_u64(0);
let mut buf = vec![0; 2048]; let mut buf = vec![0; 2048];
let n = 100; let n = 100;

Loading…
Cancel
Save