BugFixes - Fixes for what I consider to be bugs
Here are some small bugfixes.
A module may have at most 64 KB of global variables, as otherwise fixups to exported variables may fail. Enforce this in the compiler.
If you delete text from a Drawing, the extra letters get moved into a Texts.Buffer
called Tbuf
.
Only that this buffer is never initialized, resulting in memory corruption if you delete enough text.
If allocation of a small amount from a large block fails, the system will still store the "second half" of the null pointer into the free lists, resulting in memory corruption as soon as these free lists are used.
As discussed on the mailing list (PO: Illegal memory access in GC
), the garbage collector
will read from IO address -4 when it encounters a NIL pointer and tries to read the metadata
preceding the pointer. By construction, IO address -4 is unused and will return 0, but better
to avoid these accesses if possible.
When compiling code like the following, which contains a set literal where the bounds are not constant, the compiler emitted correct code to calculate the set literal, but remembered the wrong register index, so the value was not correctly used.
MODULE Test;
PROCEDURE Mask(a: SET; b: INTEGER): SET;
RETURN a - {b .. b + 7}
END Mask;
BEGIN
ASSERT( Mask( {0..31}, 8 ) = {0..7, 16..31} )
END Test.
When dragging the mouse pointer to the top of the screen while scrolling, the scroll cursor was drawn partially outside the screen and could corrupt the IO memory area.
-
Apply
CheckGlobalsSize.patch
toORG.Mod
-
Apply
InitializeGraphicFramesTbuf.patch
toGraphicFrames.Mod
-
Apply
NoMemoryCorruptionAfterMemoryAllocationFailure.patch
toKernel.Mod
-
Apply
IllegalAccessInGC.patch
toKernel.Mod
-
Apply
CompileSetLiterals.patch
toORG.Mod
-
Apply
FixScrollCursorCorruption.patch
toTextFrames.Mod
-
Recompile the changed modules and rebuild the inner core:
ORP.Compile Kernel.Mod ~ ORL.Link Modules ~ ORL.Load Modules.bin ~ ORP.Compile TextFrames.Mod ~ ORP.Compile GraphicFrames.Mod ~ ORP.Compile ORG.Mod ~
-
Restart the system.