RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Code review →

Error handling improvement. Really?

Subscribe to Error handling improvement. Really? 6 posts, 5 voices

 
Aug 22, 2023 6:49am
Avatar André Timmermans (100) 567 posts

I have noticed this in the latest merge:


        MOV     r0, #WimpSysInfo_WimpVersion
        SWI     XWimp_ReadSysInfo
        SUB     r0, r0, #256

Where the X was added in XWimp_ReadSysInfo.

I get using the X form, but it should perform a MOVVS R0, #0 or another suitably low WimpVersion value if the call fails to avoid the error pointer simulating a ridiculously high WimpVersion value.

 
Aug 22, 2023 7:21am
Avatar Sprow (202) 1075 posts

but it should perform a MOVVS R0, #0 or another suitably low WimpVersion value

The only outcome of the highness/lowness of the version is whether it sets or clears 2 internal flags. Those flags are only inspected when an application wants to use a filter, Filter Manager wants to register with the Wimp, or Filter Manager is called by the Wimp.

In the 1st case, how is the application running? There’s no Wimp, we already established that. In the 2nd case how would it register with the Wimp? There’s no Wimp, we already established that. In the 3rd case how would it be called? There’s no Wimp, we already established that.

 
Aug 22, 2023 7:02pm
Avatar André Timmermans (100) 567 posts

So it works because because we are in conditions where we don’t care if it sets the flags incorrectly? Scary!

 
Aug 22, 2023 7:23pm
Avatar Steve Pampling (1551) 7581 posts

So it works because we are in conditions where we don’t care if it sets the flags incorrectly? Scary!

There is so much of the OS that doesn’t check input parameter limits, that one item like that gets lost in the background noise.

 
Aug 22, 2023 8:39pm
Avatar Rick Murray (539) 12881 posts

we don’t care if it sets the flags incorrectly?

We’re in conditions, it would seem, that the call literally cannot fail as the Wimp must exist to get to that point.

But as Steve points out… ;)

 
Aug 22, 2023 8:43pm
Avatar Paolo Fabio Zaino (28) 1612 posts

There is so much of the OS that doesn’t check input parameter limits,

yup :(

RAM is not clocked @ 8Mhz by a while I think… we’re not using an ARM2 by a while too (IIRC!), so why aren’t we trying to improve at least the API robustness? Do people really like their RISC OS machines crashing in the name of “I want all the control”?1

Vive le retro’ :)

1 Sorry for the sarcasm, just had a day of retro tech behaving in all sorts of bizarre manners lol

Reply

To post replies, please first log in.

Forums → Code review →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Developer peer review of proposed code alterations.

Voices

  • André Timmermans (100)
  • Sprow (202)
  • Steve Pampling (1551)
  • Rick Murray (539)
  • Paolo Fabio Zaino (28)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys