sincos took cos as sqrt(1 - sin*sin): its sign was lost and it was
0 near pi/2 (tan(pi/2) gave large, tan(-pi) the wrong sign); REAL tan
and sin/cos reduced in LONGREAL with REAL pi and pi/2; REAL arcsin and
arccos returned their unadjusted value after any earlier error
(err stays set). in oocLowReal, scale, intpart, trunc and round
treated a REAL as a 64 bit SET (RealMath.sqrt(2) was about 1E9); now
with Reals.SetExpo and ENTIER. LowReal.small and LowLReal.small are
the exact constants again. the math test expects the right values.
the scanner built a decimal constant digit by digit, rounding at
each step (1.1D3 was not 1100), and the code generator wrote reals
with 15 digits, so very small values came out as 0 (LowReal.small,
LowLReal.small, MathL's miny). now the scanner converts with strtod
and strtof, a constant is out of range only when its value is, and
reals are written with 17 significant digits, which read back as the
same double. MAX(REAL) and MAX(LONGREAL) are set from their bits
(MAX(LONGREAL) was 1.79769296342094D308).
the exponent digits were written before the mantissa was rounded, so
a carry into the next power of ten was lost: 0.99999999999999989
came out as 1.0D-001, and Math.sqrt(1.0) as 1.00000E-01.
console module only flushes its internal buffer on lf or when full.
files without a trailing newline silently lost their last line on exit.
switching to out module and calling out.flush after processing each file
guarantees all buffered output is written.
- adding Platform.LittleEndian to centralize endianness detection
- using SYSTEM.GET with correct byte offset for HUGEINT to smaller type reads on big-endian
- fixing Reals.BytesToHex iteration direction and InitEndian for big-endian
- fixing oocLowReal fraction, IsInfinity, IsNaN using Reals.Expo/SetExpo
- fixing Math.ToREAL and MathL.exponent for big-endian
- fixing In.Int and In.LongInt for big-endian
- fixing outtest.wh byte iteration direction for big-endian
- regenerating all bootstrap C sources
- tested on ppc32
assigning adrtyp a dedicated symbol file back-reference tag (Sadr=12)
so it round-trips through symbol files as adrtyp rather than deserializing
as int32typ/int64typ, preventing false err(115) when passing procedures
with SYSTEM.ADDRESS parameters across module boundaries.
declaring a parameter as 'name-: TYPE' passes it by reference for
efficiency but prevents assignment within the procedure body.
per xds oberon-2 documentation, '-' is a modifier on value parameters
only; combining it with VAR is an error (246).
adding 'readOnlyPar = 3' to the vis field constants on OPT.Object.
setting node^.readonly in OPB.Ident for VarPar nodes whose object
has vis = readOnlyPar, which causes OPB.Assign to emit err(76) on
any attempt to write the parameter or its components.
relaxing OPB.Param to allow passing a read-only variable as an
actual argument to a read-only formal (previously blocked by err(76)
because VarPar checked ap^.readonly unconditionally).
adding Srpar = 42 symbol file tag so that read-only parameters
survive across module boundaries: OutSign writes Srpar and InSign
reconstructs the mode and vis correctly when importing.
code generation in OPV is unchanged; read-only parameters produce
the same C as VAR parameters since the restriction is purely semantic.
passing a 2d static array to an open array parameter generated no
(void*) cast, because the condition only checked for VarPar mode.
adding a check for whether the formal element type is composite
(typ^.BaseTyp^.form = OPT.Comp) catches the pointer-indirection
mismatch for nested arrays, matching the fix in ofrontplus fe43645.
assigning a pointer-to-extension to a pointer-to-base failed to
cast when the pointer type was anonymous (strobj = NIL). falling
back to casting through the base type's strobj when the pointer
type itself has no name, matching the fix in ofrontplus 69e7660.
fixes issue #105.
gentoo (and possibly others) write ID='gentoo' with single quotes in
/etc/os-release. ParseOsRelease was only stripping double quotes and
using ascii comparison to find the end of the value, which caused
single quotes to be embedded in the os string, producing invalid oberon
like os* = ''gentoo''.
stripping both quote styles at start and stopping at either kind at end.
works for unquoted values (raspbian, devuan) and double-quoted values too.
the crash was introduced in aed9134e: when the rhs of an array assignment
is a pointer-dereferenced dynamic array (e.g. s^), the rhs node has no
named obj, so obj is nil. the dynArr branch in OPV was calling OPC.Len
which dereferences obj immediately, causing a segfault in the compiler.
OPV already has a Len() procedure that handles Nderef nodes by generating
ptr->len[dim] instead of relying on a named obj. switching to that call
fixes the crash and generates correct bounds-checked C code.
removing the err(113) workaround in OPB.CheckAssign that was suppressing
the crash by rejecting valid oberon-07 assignments.
fixes issue #55.