ref: 0dad804010351b45fd7d1b0b608886412f518593
parent: b9101d2b5a8fd441c8c940222e1aa8072e5d0cee
author: mia soweli <[email protected]>
date: Mon Aug 28 22:42:03 EDT 2023
trap: fp invalid checks in note handling
--- a/trap.c
+++ b/trap.c
@@ -205,6 +205,12 @@
procctl();
if(up->nnote == 0)
return 0;
+
+ if(up->fpstate == FPactive) {
+ fpsave(up->fpsave);
+ up->fpstate = FPinactive;
+ }
+ up->fpstate |= FPillegal;
s = spllo();
qlock(&up->debug);
@@ -260,6 +266,7 @@
}
up->notified = 0;
+ up->fpstate &= ~FPillegal;
nureg = up->ureg;
oureg = (ulong) nureg;
if(!okaddr(oureg - BY2WD, BY2WD + sizeof(Ureg), 0) || (oureg & 3) != 0) {