Commit 38fd341c authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix alignment fault when reporting the "This file doesn't contain a BASIC program" error

Detail:
  rlib/c/txtedit - Rather than generating a proper error block to send to Wimp_ReportError, txtedit__validbasicfile was just subtracting 4 from the pointer to the error string.
  The resulting address isn't guaranteed to be aligned properly, resulting in an alignment fault on ARMv7 when Wimp_ReportError examines the error number.
  The new code just reuses the 'buff' array to build a temporary error block.
Admin:
  Fixes alignment fault on beagleboard when attempting to load a detokenized BASIC file into !Edit.


Version 5.57. Tagged as 'RISC_OSLib-5_57'
parent 96b4a3c3
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "5.56" Module_MajorVersion SETS "5.57"
Module_Version SETA 556 Module_Version SETA 557
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "28 Nov 2009" Module_Date SETS "26 Nov 2010"
Module_ApplicationDate SETS "28-Nov-09" Module_ApplicationDate SETS "26-Nov-10"
Module_ComponentName SETS "RISC_OSLib" Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "castle/RiscOS/Sources/Lib/RISC_OSLib" Module_ComponentPath SETS "castle/RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.56" Module_FullVersion SETS "5.57"
Module_HelpVersion SETS "5.56 (28 Nov 2009)" Module_HelpVersion SETS "5.57 (26 Nov 2010)"
END END
/* (5.56) /* (5.57)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 5.56 #define Module_MajorVersion_CMHG 5.57
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Nov 2009 #define Module_Date_CMHG 26 Nov 2010
#define Module_MajorVersion "5.56" #define Module_MajorVersion "5.57"
#define Module_Version 556 #define Module_Version 557
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "28 Nov 2009" #define Module_Date "26 Nov 2010"
#define Module_ApplicationDate "28-Nov-09" #define Module_ApplicationDate "26-Nov-10"
#define Module_ComponentName "RISC_OSLib" #define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "castle/RiscOS/Sources/Lib/RISC_OSLib" #define Module_ComponentPath "castle/RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.56" #define Module_FullVersion "5.57"
#define Module_HelpVersion "5.56 (28 Nov 2009)" #define Module_HelpVersion "5.57 (26 Nov 2010)"
#define Module_LibraryVersionInfo "5:56" #define Module_LibraryVersionInfo "5:57"
...@@ -2275,8 +2275,11 @@ static BOOL txtedit__validbasicfile(char *filename) ...@@ -2275,8 +2275,11 @@ static BOOL txtedit__validbasicfile(char *filename)
} }
os_swi2(OS_Find, 0, r1); /* close the file */ os_swi2(OS_Find, 0, r1); /* close the file */
if (!result) { if (!result) {
_kernel_oserror *e = (_kernel_oserror *) buff; /* Reuse buff since it's big enough */
e->errnum = 0;
strcpy(e->errmess,msgs_lookup(MSGS_bas1));
r1 = _swi(Wimp_ReportError, _IN(0)|_IN(1)|_IN(2)|_RETURN(1), r1 = _swi(Wimp_ReportError, _IN(0)|_IN(1)|_IN(2)|_RETURN(1),
msgs_lookup(MSGS_bas1) - 4, 3, wimpt_programname()); e, 3, wimpt_programname());
if (r1 == 2) return 2; if (r1 == 2) return 2;
} }
} }
......
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