diff --git a/trap.c b/trap.c
index 533f3f0a43eef4abe2a5e584679b262f52c5669a..fd000716b7b2400bfbc8173407c7e3d627e78ecb 100644
--- a/trap.c
+++ b/trap.c
@@ -91,4 +91,8 @@ trap(struct trapframe *tf)
   // If interrupts were on while locks held, would need to check nlock.
   if(cp && cp->state == RUNNING && tf->trapno == IRQ_OFFSET+IRQ_TIMER)
     yield();
+
+  // Check if the process has been killed since we yielded
+  if(cp && cp->killed && (tf->cs&3) == DPL_USER)
+    exit();
 }