From 354a67386ed26a357f3f8f48dfb6d760887f17c1 Mon Sep 17 00:00:00 2001 From: Marvel Renju Date: Mon, 9 Sep 2024 12:45:12 +0100 Subject: [PATCH] Fix setBounds not clearing tag (#12) Ensure tag is cleared if the result is not in bounds --- CHERICC_Fat.bsv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHERICC_Fat.bsv b/CHERICC_Fat.bsv index 451ce38..ed6b2e4 100644 --- a/CHERICC_Fat.bsv +++ b/CHERICC_Fat.bsv @@ -668,6 +668,9 @@ function SetBoundsReturn#(CapFat, CapAddrW) setBoundsFat(CapFat cap, Address len Bool resultInBounds = newBaseInBounds && newTopInBounds && !addressWrap; + // Nullify the capability if the result is not in bounds + if (!resultInBounds) ret.isCapability = False; + // Return derived capability return SetBoundsReturn { cap: ret , exact: exact