summaryrefslogtreecommitdiff
path: root/cheri
diff options
context:
space:
mode:
authorRobert Norton2017-07-04 10:13:11 +0100
committerRobert Norton2017-07-04 10:13:11 +0100
commita997b01332273eb7535df307c2939bf5e9ed3a35 (patch)
treefd381bf06e71e6e86f95b825bb692da8e822ae10 /cheri
parente8d6977d677d9eab570b993816fa3bd946d5142d (diff)
change to cgettype -- returns -1 if not sealed instead of 0.
Diffstat (limited to 'cheri')
-rw-r--r--cheri/cheri_insts.sail4
1 files changed, 3 insertions, 1 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail
index 96127906..e6228217 100644
--- a/cheri/cheri_insts.sail
+++ b/cheri/cheri_insts.sail
@@ -71,7 +71,9 @@ function clause execute (CGetType(rd, cb)) =
raise_c2_exception(CapEx_AccessSystemRegsViolation, cb)
else
let capVal = readCapReg(cb) in
- wGPR(rd) := EXTZ(capVal.otype);
+ wGPR(rd) := if (capVal.sealed)
+ then EXTZ(capVal.otype)
+ else -1
(* END_CGetType *)
}