feature/igc3 64f598cbc6e: * mps/code/protix.c (ProtSet): More informative error message

Helmut Eller <[email protected]> Thu, 30 Jul 2026 03:45:22 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: feature/igc3
commit 64f598cbc6e6ba187d537b24adf377c2d033cc5a
Author: Helmut Eller <[email protected]>
Commit: Helmut Eller <[email protected]>

    * mps/code/protix.c (ProtSet): More informative error message
    
    Old message:  assertion failed: unreachable code
    New message:  assertion failed: error != ENOMEM
---
 mps/code/protix.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mps/code/protix.c b/mps/code/protix.c
index 18f29430e07..7072117ca1a 100644
--- a/mps/code/protix.c
+++ b/mps/code/protix.c
@@ -114,8 +114,14 @@ void ProtSet(Addr base, Addr limit, AccessSet mode)
     prot_all = PROT_READ | PROT_WRITE;
     result = mprotect((void *)base, (size_t)AddrOffset(base, limit), flags & prot_all);
   }
-  if (result != 0)
+  if (result != 0) {
+    int error = errno;
+    AVER(error != EACCES);
+    AVER(error != EINVAL);
+    AVER(error != ENOMEM);
+    AVER(error != 0);
     NOTREACHED;
+  }
 }