@@ -18,6 +18,7 @@ pub enum DiffValue {
1818 ExternRef { null : bool } ,
1919 AnyRef { null : bool } ,
2020 ExnRef { null : bool } ,
21+ ContRef { null : bool } ,
2122}
2223
2324impl DiffValue {
@@ -32,6 +33,7 @@ impl DiffValue {
3233 DiffValue :: ExternRef { .. } => DiffValueType :: ExternRef ,
3334 DiffValue :: AnyRef { .. } => DiffValueType :: AnyRef ,
3435 DiffValue :: ExnRef { .. } => DiffValueType :: ExnRef ,
36+ DiffValue :: ContRef { .. } => DiffValueType :: ContRef ,
3537 }
3638 }
3739
@@ -189,6 +191,7 @@ impl DiffValue {
189191 ExternRef => DiffValue :: ExternRef { null : true } ,
190192 AnyRef => DiffValue :: AnyRef { null : true } ,
191193 ExnRef => DiffValue :: ExnRef { null : true } ,
194+ ContRef => DiffValue :: ContRef { null : true } ,
192195 } ;
193196 arbitrary:: Result :: Ok ( val)
194197 }
@@ -236,6 +239,7 @@ impl Hash for DiffValue {
236239 DiffValue :: FuncRef { null } => null. hash ( state) ,
237240 DiffValue :: AnyRef { null } => null. hash ( state) ,
238241 DiffValue :: ExnRef { null } => null. hash ( state) ,
242+ DiffValue :: ContRef { null } => null. hash ( state) ,
239243 }
240244 }
241245}
@@ -273,6 +277,7 @@ impl PartialEq for DiffValue {
273277 ( Self :: ExternRef { null : a } , Self :: ExternRef { null : b } ) => a == b,
274278 ( Self :: AnyRef { null : a } , Self :: AnyRef { null : b } ) => a == b,
275279 ( Self :: ExnRef { null : a } , Self :: ExnRef { null : b } ) => a == b,
280+ ( Self :: ContRef { null : a } , Self :: ContRef { null : b } ) => a == b,
276281 _ => false ,
277282 }
278283 }
@@ -291,6 +296,7 @@ pub enum DiffValueType {
291296 ExternRef ,
292297 AnyRef ,
293298 ExnRef ,
299+ ContRef ,
294300}
295301
296302impl TryFrom < wasmtime:: ValType > for DiffValueType {
@@ -310,6 +316,7 @@ impl TryFrom<wasmtime::ValType> for DiffValueType {
310316 ( true , HeapType :: I31 ) => Ok ( Self :: AnyRef ) ,
311317 ( true , HeapType :: None ) => Ok ( Self :: AnyRef ) ,
312318 ( true , HeapType :: Exn ) => Ok ( Self :: ExnRef ) ,
319+ ( true , HeapType :: Cont ) => Ok ( Self :: ContRef ) ,
313320 _ => Err ( "non-null reference types are not supported yet" ) ,
314321 } ,
315322 }
0 commit comments