From 1c3acdc58d0f95fb5a62779dc59eac4728b5e26e Mon Sep 17 00:00:00 2001 From: Peter Rugg Date: Sun, 26 May 2019 16:27:53 +0100 Subject: [PATCH] Rework Kind reporting to match specified behaviour of CGetSealed and CGetType --- CHERICap.bsv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHERICap.bsv b/CHERICap.bsv index 9d8ed5a..7a155de 100644 --- a/CHERICap.bsv +++ b/CHERICap.bsv @@ -109,10 +109,9 @@ typeclass CHERICap#(type t, numeric type ot, numeric type flg, numeric type n, n // Get the kind of the capability, i.e. whether it is sealed, sentry, unsealed, ... function Kind getKind (t cap); // Helper methods for identifying specific kinds - function Bool isUnsealed (t cap) = getKind(cap) == UNSEALED; function Bool isSentry (t cap) = getKind(cap) == SENTRY; function Bool isSealedWithType (t cap) = getKind(cap) == SEALED_WITH_TYPE; - function Bool isSealed (t cap) = getKind(cap) == SEALED_WITH_TYPE || getKind(cap) == SENTRY; + function Bool isSealed (t cap) = getKind(cap) != UNSEALED; // Get the type field, including implicitly whether the cap is sealed/sentry function Bit#(ot) getType (t cap);