Skip to content

Commit

Permalink
break: panic if break detected not in DOS
Browse files Browse the repository at this point in the history
This is needed to catch bugs, like the one fixed in 3a91204
  • Loading branch information
stsp committed Oct 10, 2023
1 parent d0c57ac commit 0e84519
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/break.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ void handle_break(struct dhdr FAR *pdev)
CB_FLG &= ~CB_MSK; /* reset the ^Break flag */
con_flush(pdev);
cooked_write(pdev, 4, buf);
if (!ErrorMode) /* within int21_handler, InDOS is not incremented */
if (!ErrorMode) { /* within int21_handler, InDOS is not incremented */
if (InDOS)
--InDOS; /* fail-safe */
else
panic("Break not in DOS");
}

spawn_int23(); /* invoke user INT-23 and never come back */
}
Expand Down

0 comments on commit 0e84519

Please sign in to comment.