From ddda8969d55f2c76f24ea29fce33030851cff5bf Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Fri, 15 Apr 2016 14:13:59 +0100 Subject: cseal: perform arithmetic using nats to avoid signed comparison. Should maybe do this in readCapReg --- cheri/cheri_insts.sail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index a2d168cd..88516bb4 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -343,7 +343,7 @@ function clause execute (CSeal(cd, cs, ct)) = exit (raise_c2_exception(CapEx_SealViolation, ct)) else if (~(ct_val.permit_seal)) then exit (raise_c2_exception(CapEx_PermitSealViolation, ct)) - else if ((ct_val.offset) >= (ct_val.length)) then + else if ((nat)(ct_val.offset) >= (nat)(ct_val.length)) then exit (raise_c2_exception(CapEx_LengthViolation, ct)) else if (ct_cursor > max_otype) then exit (raise_c2_exception(CapEx_LengthViolation, ct)) -- cgit v1.2.3