blaise/docs
Graeme Geldenhuys 712263abd4 feat(rtl): integer div/mod by zero raises catchable EDivByZero
Integer div and mod by zero previously trapped in hardware (SIGFPE),
uncatchable even inside try/except — a single bad divisor terminated the
process.  Both backends now emit a divisor-zero guard before each integer
idiv that raises a catchable EDivByZero exception via the normal exception
machinery, matching standard Pascal/Delphi semantics.

- SysUtils: add EDivByZero = class(Exception) and the _RaiseDivByZero helper
  that raises EDivByZero('Division by zero').
- QBE + native x86-64: emit a divisor==0 check before integer div/rem
  (32- and 64-bit); on zero, call SysUtils__RaiseDivByZero (which longjmps).
- The guard is emitted only when SysUtils is in scope (EDivByZero resolves
  through the symbol table); without SysUtils, division traps as before.
  This mirrors Delphi's placement of EDivByZero in System.SysUtils and keeps
  the always-linked runtime free of stdlib class machinery.
- Tests: in-process e2e proves the guard does not disturb normal division on
  both backends; shell-out cli tests (real compiler + linked stdlib) prove
  catchable div/mod-by-zero on both backends.
- Rationale recorded in language-rationale.adoc.

All three fixpoints green (FIXPOINT_OK, NATIVE_FIXPOINT_OK,
NATIVE_INTERNAL_OK); full suite OK (3345 tests).
2026-06-16 23:04:56 +01:00
..
benchmark.txt docs(benchmark): add QBE 1.3 measurement entry 2026-06-02 17:17:54 +01:00
bif-format.adoc docs: .bif file format reference 2026-06-03 19:40:08 +01:00
design.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
extending-ast.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
future-improvements.adoc feat(sets): range syntax in set literals — [lo..hi] (#105) 2026-06-15 17:14:05 +01:00
grammar.ebnf feat(generics): out-of-line impl form for generic methods + arg checking 2026-06-16 16:30:07 +01:00
internal-linker-design.adoc test: add assembler/ELF writer tests and internal linker design doc 2026-06-12 09:55:44 +01:00
language-rationale.adoc feat(rtl): integer div/mod by zero raises catchable EDivByZero 2026-06-16 23:04:56 +01:00
name-mangling.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
native-const-arg-arc-port.adoc docs: native const-arg ARC port design — mark implemented 2026-06-11 07:36:13 +01:00
testing-strategy.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00