summaryrefslogtreecommitdiff
path: root/cheri
diff options
context:
space:
mode:
authorRobert Norton2016-04-29 15:32:05 +0100
committerRobert Norton2016-04-29 15:32:05 +0100
commitf9c25890e174ede61130316d0cfc7b9416400e5a (patch)
tree0a77559bc3c823a23cfdb500aff10164132c6eb9 /cheri
parentef3deb63b3eead7e3b3ec826fd3d4f5695d642df (diff)
use the correct exception vector for ccall/creturn.
Diffstat (limited to 'cheri')
-rw-r--r--cheri/cheri_insts.sail2
-rw-r--r--cheri/cheri_prelude.sail5
2 files changed, 5 insertions, 2 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail
index 935f47ca..fe77df82 100644
--- a/cheri/cheri_insts.sail
+++ b/cheri/cheri_insts.sail
@@ -414,7 +414,7 @@ function clause execute (CCall(cs, cb)) =
else if (cs_val.offset >= cs_val.length) then
exit (raise_c2_exception(CapEx_LengthViolation, cs))
else
- exit (raise_c2_exception_noreg(CapEx_CallTrap));
+ exit (raise_c2_exception(CapEx_CallTrap, cs));
}
union ast member unit CReturn
diff --git a/cheri/cheri_prelude.sail b/cheri/cheri_prelude.sail
index 9c7e4d20..6aaa9a0c 100644
--- a/cheri/cheri_prelude.sail
+++ b/cheri/cheri_prelude.sail
@@ -300,7 +300,10 @@ function unit raise_c2_exception8((CapEx) capEx, (bit[8]) regnum) =
{
(CapCause.ExcCode) := CapExCode(capEx);
(CapCause.RegNum) := regnum;
- SignalException(C2E);
+ let mipsEx =
+ if ((capEx == CapEx_CallTrap) | (capEx == CapEx_ReturnTrap))
+ then C2Trap else C2E in
+ SignalException(mipsEx);
}
function unit raise_c2_exception((CapEx) capEx, (regno) regnum) =