@@ -224,6 +224,7 @@ bool shapeEq(HeapType a, HeapType b);
224224bool shapeEq (const Struct& a, const Struct& b);
225225bool shapeEq (Array a, Array b);
226226bool shapeEq (Signature a, Signature b);
227+ bool shapeEq (Continuation a, Continuation b);
227228bool shapeEq (Field a, Field b);
228229bool shapeEq (Type a, Type b);
229230bool shapeEq (const Tuple& a, const Tuple& b);
@@ -232,6 +233,7 @@ size_t shapeHash(HeapType a);
232233size_t shapeHash (const Struct& a);
233234size_t shapeHash (Array a);
234235size_t shapeHash (Signature a);
236+ size_t shapeHash (Continuation a);
235237size_t shapeHash (Field a);
236238size_t shapeHash (Type a);
237239size_t shapeHash (const Tuple& a);
@@ -690,7 +692,10 @@ bool shapeEq(HeapType a, HeapType b) {
690692 }
691693 break ;
692694 case HeapTypeKind::Cont:
693- WASM_UNREACHABLE (" TODO: cont" );
695+ if (!shapeEq (a.getContinuation (), b.getContinuation ())) {
696+ return false ;
697+ }
698+ break ;
694699 case HeapTypeKind::Basic:
695700 WASM_UNREACHABLE (" unexpected kind" );
696701 }
@@ -719,7 +724,8 @@ size_t shapeHash(HeapType a) {
719724 hash_combine (digest, shapeHash (type.getArray ()));
720725 continue ;
721726 case HeapTypeKind::Cont:
722- WASM_UNREACHABLE (" TODO: cont" );
727+ hash_combine (digest, shapeHash (type.getContinuation ()));
728+ continue ;
723729 case HeapTypeKind::Basic:
724730 continue ;
725731 }
@@ -762,6 +768,10 @@ size_t shapeHash(Signature a) {
762768 return digest;
763769}
764770
771+ bool shapeEq (Continuation a, Continuation b) { return shapeEq (a.type , b.type ); }
772+
773+ size_t shapeHash (Continuation a) { return shapeHash (a.type ); }
774+
765775bool shapeEq (Field a, Field b) {
766776 return a.packedType == b.packedType && a.mutable_ == b.mutable_ &&
767777 shapeEq (a.type , b.type );
0 commit comments