Skip to content

Commit 94f1378

Browse files
committed
fix fuzzing build
1 parent 8f6e2eb commit 94f1378

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

crates/fuzzing/src/generators/value.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub enum DiffValue {
1717
FuncRef { null: bool },
1818
ExternRef { null: bool },
1919
AnyRef { null: bool },
20+
ExnRef { null: bool },
2021
}
2122

2223
impl DiffValue {
@@ -30,6 +31,7 @@ impl DiffValue {
3031
DiffValue::FuncRef { .. } => DiffValueType::FuncRef,
3132
DiffValue::ExternRef { .. } => DiffValueType::ExternRef,
3233
DiffValue::AnyRef { .. } => DiffValueType::AnyRef,
34+
DiffValue::ExnRef { .. } => DiffValueType::ExnRef,
3335
}
3436
}
3537

@@ -186,6 +188,7 @@ impl DiffValue {
186188
FuncRef => DiffValue::FuncRef { null: true },
187189
ExternRef => DiffValue::ExternRef { null: true },
188190
AnyRef => DiffValue::AnyRef { null: true },
191+
ExnRef => DiffValue::ExnRef { null: true },
189192
};
190193
arbitrary::Result::Ok(val)
191194
}
@@ -232,6 +235,7 @@ impl Hash for DiffValue {
232235
DiffValue::ExternRef { null } => null.hash(state),
233236
DiffValue::FuncRef { null } => null.hash(state),
234237
DiffValue::AnyRef { null } => null.hash(state),
238+
DiffValue::ExnRef { null } => null.hash(state),
235239
}
236240
}
237241
}
@@ -285,6 +289,7 @@ pub enum DiffValueType {
285289
FuncRef,
286290
ExternRef,
287291
AnyRef,
292+
ExnRef,
288293
}
289294

290295
impl TryFrom<wasmtime::ValType> for DiffValueType {
@@ -303,6 +308,7 @@ impl TryFrom<wasmtime::ValType> for DiffValueType {
303308
(true, HeapType::Any) => Ok(Self::AnyRef),
304309
(true, HeapType::I31) => Ok(Self::AnyRef),
305310
(true, HeapType::None) => Ok(Self::AnyRef),
311+
(true, HeapType::Exn) => Ok(Self::ExnRef),
306312
_ => Err("non-null reference types are not supported yet"),
307313
},
308314
}

crates/fuzzing/src/oracles/diff_v8.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ impl DiffInstance for V8Instance {
190190
// JS doesn't support v128 parameters
191191
DiffValue::V128(_) => return Ok(None),
192192
DiffValue::AnyRef { .. } => unimplemented!(),
193+
DiffValue::ExnRef { .. } => unimplemented!(),
193194
});
194195
}
195196
// JS doesn't support v128 return values
@@ -313,6 +314,7 @@ fn get_diff_value(
313314
null: val.is_null(),
314315
},
315316
DiffValueType::AnyRef => unimplemented!(),
317+
DiffValueType::ExnRef => unimplemented!(),
316318
DiffValueType::V128 => unreachable!(),
317319
}
318320
}

crates/fuzzing/src/oracles/diff_wasmi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ impl From<&DiffValue> for wasmi::Val {
194194
WasmiValue::ExternRef(wasmi::ExternRef::null())
195195
}
196196
DiffValue::AnyRef { .. } => unimplemented!(),
197+
DiffValue::ExnRef { .. } => unimplemented!(),
197198
}
198199
}
199200
}

crates/fuzzing/src/oracles/diff_wasmtime.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ impl From<&DiffValue> for Val {
223223
assert!(null);
224224
Val::AnyRef(None)
225225
}
226+
DiffValue::ExnRef { null } => {
227+
assert!(null);
228+
Val::ExnRef(None)
229+
}
226230
}
227231
}
228232
}
@@ -238,6 +242,7 @@ impl From<Val> for DiffValue {
238242
Val::ExternRef(r) => DiffValue::ExternRef { null: r.is_none() },
239243
Val::FuncRef(r) => DiffValue::FuncRef { null: r.is_none() },
240244
Val::AnyRef(r) => DiffValue::AnyRef { null: r.is_none() },
245+
Val::ExnRef(e) => DiffValue::ExnRef { null: e.is_none() },
241246
}
242247
}
243248
}

0 commit comments

Comments
 (0)