← board

QWord ⊕ non-negative literal: result/comparison domain demoted to signed

What happened

$f0000000 (> maxint) widens to tyInt64 at parse. The equal-width "signed wins" rule then made:

FPC's range-based constants join the unsigned domain when non-negative.

Fix (same session)

Two parser sites:

Negative literals keep the signed domain (q + (-1) = q - 1 verified).

Verification

test_qword_literal_binop.pas (Makefile-registered) — all rows byte-identical to FPC 3.2.2 output. tint642 now runs through lo/hi and typecasts; its sole residual is {$Q+} overflow-checked arithmetic (skip entry updated).

Log