No public description

PiperOrigin-RevId: 875838830
Change-Id: I52d5379c361ee61b2449dcee9e2021c9c0c884ef
diff --git a/cheriot/cheriot_register.cc b/cheriot/cheriot_register.cc
index fe46f1e..7926a57 100644
--- a/cheriot/cheriot_register.cc
+++ b/cheriot/cheriot_register.cc
@@ -213,7 +213,7 @@
   // representable length for the exponent, and if so, set the length to the
   // maximum representable length. Otherwise, perform any rounding down of the
   // length that may be required based on the exponent.
-  if (req_length > 511 * (1ULL << exp)) {
+  if ((req_length >> exp) >= 512) {
     new_length = 511 * (1ULL << exp);
   } else {
     new_length = (req_length >> exp) << exp;