Skip to content

Blaise v0.16.2

Latest

Choose a tag to compare

@graemeg graemeg released this 04 Dec 12:55
· 3 commits to master since this release

Blaise v0.16.2 — Changelog

A bug-fix release, cut from master. It carries every fix made since v0.16.0, including the two x86-64 fixes v0.16.1 shipped. Fatal runtime errors now end with a message and FPC's exit codes. The archives bundle pdr 0.5.0, which stops where a program raises an exception or ends with a runtime error. There are no breaking language changes. A program that used to end silently, with an abort or a signal, now prints Runtime error <code>: <message> and exits with that code.

Runtime

  • Fatal runtime errors end through one routine, with FPC's codes. Every fatal error without an exception object now writes Runtime error <code>: <message> to standard error and exits with the code: 101 file write failed, 200 division by zero, 201 range check, 210 nil check, 211 abstract method, 217 unhandled exception, 219 invalid typecast. Before, an unhandled exception aborted with no message (status 134), and division by zero in a program without SysUtils trapped (SIGTRAP on arm64, SIGFPE on x86-64). The unhandled-exception report names the class, and with SysUtils linked it adds the exception's message. The abstract-method message no longer writes a stray NUL.

Debugging

  • OPDF names the raise and runtime-error hooks. The debug info now carries two more runtime-helper records, for _Raise and _RuntimeError. pdr breaks on them, so it stops where a Blaise program raises an exception or ends with a runtime error, on ELF and Mach-O alike, with no symbol table needed. Older pdr builds skip record kinds they do not know.
  • pdr 0.5.0 is bundled (from 0.3.1). It stops on a raise and on a runtime error. A breakpoint stops every thread of the program on Linux, FreeBSD and macOS. On macOS, two threads trapping at once no longer hang it. Attach applies the ASLR slide, and step-into moves by source line through runtime helpers. pdr-dap answers with an Arguments scope for a routine's parameters. Release: https://github.com/graemeg/opdebugger/releases/tag/v0.5.0

stdlib

  • Net.Tls.Provider loads OpenSSL when the first TLS context is made, rather than at program start, so a program that never uses TLS never needs OpenSSL.
  • A failed OpenSSL load says how to install OpenSSL 3 on the platform it runs on.

Codegen

  • A non-local exit drops the state a finally or handler pushed. Exit, Break or Continue out of an exception-path finally body leaked the exception being discarded (and on x86-64 left the stack 8 bytes deeper). On arm64, leaving an except handler grew the stack by 16 bytes each time: a million handled exceptions with Continue in the handler crashed.
  • An inlined finally body runs at its own try's depth. Exit inside a finally body that was inlined at an exit point made the compiler recurse until it crashed; Break and Continue in it bound to the wrong loop.
  • A member multi-dimensional const array honours its outer subscript. TK.KG[1, 0] read row 0 on arm64 and loaded a pointer from the row on x86-64. On arm64, copying such an array or one of its rows into a field also stopped with an internal error.
  • arm64: a narrow result of a call through a cdecl procedural type is widened. A C int of -1 read back as 4294967295. This broke every TLS handshake on macOS through the dlsym-bound OpenSSL routines.
  • arm64: a for loop in a finally body compiles when the try exits. It failed with an internal error about __for_end_1.
  • arm64: Free on a record's object field uses the record's address.
  • x86-64: a call's record result reaches a variable a closure captures (shipped in v0.16.1).
  • x86-64: routine-local set constants with more than 64 elements are emitted (shipped in v0.16.1).

Semantic

  • Nested routines take defaults and overloads (GH #274). A call leaving out a defaulted parameter was rejected, and overloads of one nested name collided on one symbol. Found on the way, and also fixed: value arguments to nested routines were never type-checked; an anonymous method saw only the first nested overload; a forward-declared nested overload paired with the wrong body; and a -> argument to a nested function was rejected.
  • Constants of named array types take any element list (GH #274). const C: TArr = (-1, 2) failed to parse. A constant of a named multi-dimensional array type counted only the outer extent.
  • A generic routine's instance is analysed in the template's context. Bare names in its body bound to the calling method's members, the caller's locals shadowed globals, and Break was accepted when the call sat inside a loop.
  • A generic routine declared inside a routine is rejected with a message saying to declare it at program or unit level. Before, code generation stopped with an internal error. The rationale is in docs/language-rationale.adoc.
  • A nested routine may call a sibling declared after it.
  • A closure in a static method sees the type's static members.
  • A static function named without () asks for the parentheses.
  • Type-mismatch messages name an unnamed procedural type by its signature. Assigning @Q to an untyped Pointer now says how to convert it.

Release artefacts

Archive Built Verified
blaise-v0.16.2-macos-arm64.tar.gz native stage-2 on macOS every fixpoint and the full suites on macOS; every program in the repository built and run; a debug session with the bundled pdr
blaise-v0.16.2-linux-x86_64.tar.gz cross-compiled on macOS byte-identical to its own Linux self-build; the full suites on Linux x86-64; a debug session with the bundled pdr on a Debian 12 VM
blaise-v0.16.2-freebsd-x86_64.tar.gz cross-compiled on macOS unpacked, used and debugged with the bundled pdr in a FreeBSD 14 VM; the CI freebsd-crosscheck job runs the self-host fixpoint and the full suite
blaise-v0.16.2-windows-x86_64.zip cross-compiled on macOS byte-identical self-build in a Windows 11 guest, and the zip unpacked and used there

Each archive is self-contained: the binary, blaise.cfg, the RTL and stdlib source and a hello.pas. The macOS, Linux and FreeBSD archives also carry pdr, pdr-dap and LICENSE-pdr from pdr 0.5.0. pdr's Blaise and DAP integration suites pass on all three platforms. On Linux, pdr needs glibc 2.34 or later. The Windows zip has no debugger yet.

Fixpoint: 1,477,067 lines of stage-2 arm64 assembly. Tests: 6,068 compiler tests and 695 stdlib tests.