summaryrefslogtreecommitdiff
path: root/cheri
diff options
context:
space:
mode:
Diffstat (limited to 'cheri')
-rw-r--r--cheri/cheri_insts.sail4
1 files changed, 2 insertions, 2 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail
index 486e33b1..20df3a62 100644
--- a/cheri/cheri_insts.sail
+++ b/cheri/cheri_insts.sail
@@ -515,7 +515,7 @@ function clause execute (CLoad(rd, cb, rt, offset, signext, width, linked)) =
{
size := wordWidthBytes(width);
cursor := getCapCursor(cb_val);
- vAddr := cursor + unsigned(rGPR(rt)) + signed(offset);
+ vAddr := cursor + unsigned(rGPR(rt)) + (size*signed(offset));
vAddr64:= (bit[64]) vAddr;
if ((vAddr + size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then
exit (raise_c2_exception(CapEx_LengthViolation, cb))
@@ -569,7 +569,7 @@ function clause execute (CStore(rs, cb, rt, rd, offset, width, conditional)) =
{
size := wordWidthBytes(width);
cursor := getCapCursor(cb_val);
- vAddr := cursor + unsigned(rGPR(rt)) + signed(offset);
+ vAddr := cursor + unsigned(rGPR(rt)) + (size * signed(offset));
vAddr64:= (bit[64]) vAddr;
if ((vAddr + size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then
exit (raise_c2_exception(CapEx_LengthViolation, cb))