Skip to content

Commit 3c87977

Browse files
committed
Fix CI: arbtest overflow and no-std HashMap lift_map
- component_fuzz: use saturating_sub in generate_hashable_key to prevent underflow when fuel is 0 and Enum variant is chosen - typed: remove incorrect ? operators in lift_map for hashbrown::HashMap (with_capacity and insert don't return Result)
1 parent 1d6ca26 commit 3c87977

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/test-util/src/component_fuzz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl Type {
227227
10 => Type::String,
228228
11 => {
229229
let amt = u.int_in_range(1..=(*fuel).max(1).min(257))?;
230-
*fuel -= amt;
230+
*fuel = fuel.saturating_sub(amt);
231231
Type::Enum(amt)
232232
}
233233
_ => unreachable!(),

crates/wasmtime/src/runtime/component/func/typed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,9 +2342,9 @@ where
23422342
K: Lift + Eq + Hash,
23432343
V: Lift,
23442344
{
2345-
let mut result = HashMap::with_capacity(len)?;
2345+
let mut result = HashMap::with_capacity(len);
23462346
lift_map_pairs(cx, key_ty, value_ty, ptr, len, |k, v| {
2347-
result.insert(k, v)?;
2347+
result.insert(k, v);
23482348
Ok(())
23492349
})?;
23502350
Ok(result)

0 commit comments

Comments
 (0)