Commit dac31a6e authored by Ben Avison's avatar Ben Avison
Browse files

Fixed potentially fatal bug in Watchdog.

  Unnecessarily complex code in Watchdog for killing tasks other than the
  currently active task ended up corrupting the environment handlers for
  the current task.
  Fixes the test case of running a BASIC program consisting of
  which previously caused random errors or complete crashes if you ran it
  and then Al-Breaked and tried to kill a different task.

Version 5.01. Tagged as 'Wimp-5_01'
parent daf3fa56
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.2.
; Last processed by srccommit version: 1.1.
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.00"
Module_Version SETA 500
Module_MajorVersion SETS "5.01"
Module_Version SETA 501
Module_MinorVersion SETS ""
Module_Date SETS "07 Oct 2007"
Module_ApplicationDate SETS "07-Oct-07"
Module_Date SETS "13 Jul 2008"
Module_ApplicationDate SETS "13-Jul-08"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.00"
Module_HelpVersion SETS "5.00 (07 Oct 2007)"
Module_FullVersion SETS "5.01"
Module_HelpVersion SETS "5.01 (13 Jul 2008)"
/* (5.00)
/* (5.01)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.2.
* Last processed by srccommit version: 1.1.
#define Module_MajorVersion_CMHG 5.00
#define Module_MajorVersion_CMHG 5.01
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Oct 2007
#define Module_Date_CMHG 13 Jul 2008
#define Module_MajorVersion "5.00"
#define Module_Version 500
#define Module_MajorVersion "5.01"
#define Module_Version 501
#define Module_MinorVersion ""
#define Module_Date "07 Oct 2007"
#define Module_Date "13 Jul 2008"
#define Module_ApplicationDate "07-Oct-07"
#define Module_ApplicationDate "13-Jul-08"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.00"
#define Module_HelpVersion "5.00 (07 Oct 2007)"
#define Module_LibraryVersionInfo "5:0"
#define Module_FullVersion "5.01"
#define Module_HelpVersion "5.01 (13 Jul 2008)"
#define Module_LibraryVersionInfo "5:1"
......@@ -206,47 +206,18 @@ watchdognext
TEQ R0,R14 ; current task going to die?
LDR R7,taskhandle
Push userblk
BL pageintask
Pull userblk
MOV R7, R14 ; keep [taskhandle] so we can restore it later
STR R0, taskhandle
BL fulltaskhandle ; R14 = full task handle for watchdogtask
STR R7, taskhandle
; current task already paged in
SWI XWimp_CloseDown
; taken from wimp_poll...
LDR R14,ptrtask
LDR R5,taskhandle
TEQ R5,R14
MOVEQ R14,#nullptr ; avoid ptr_leaving_window!
STREQ R14,ptrwindow
MOV R0,#EscapeHandler ; the domain is about to die -
SWI XOS_ReadDefaultHandler ; prevent nasty handlers from being
SWIVC XOS_ChangeEnvironment ; called when they shouldn't be!
MOV R0,#EventHandler
SWI XOS_ReadDefaultHandler
SWIVC XOS_ChangeEnvironment
MOV R0,#UpCallHandler
SWI XOS_ReadDefaultHandler
SWIVC XOS_ChangeEnvironment
BL deallocatependingtask ; delete task block (gone for good)
; reclaim memory as well!
MOV R0,#0 ; 'Press SPACE' if anything printed
BL int_commandwindow ; can't call SWI since task is dead!
CLRV ; ignore errors
STR R7,newtaskhandle
Push userblk
BL pageintask
Pull userblk
MOV R0, R14
LDR R1, taskidentifier5
SWI XWimp_CloseDown ; kill the selected task (!= current task)
Pull "R0-R7,PC"
taskidentifier5 DCB "TASK"
SWI XHourglass_Smash ; turn off hourglass (if displayed)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment