From the second review round (FredApps):
- Strings joined with `&` are printed as one flat chain, which nests one level per string. A
balanced tree of 4,096 empty strings fits in 16,383 token bytes and is 13 levels deep, but as a
chain it was 4,096 levels, and printing and dropping it recurse: on a 256 KiB stack it
overflowed. The chain is now made only up to MAX_DEPTH strings, the bound push keeps on the
decoded tree (Excel's 8,192 characters hold at most about 33 full-length constants, so Python
code split into constants is unaffected). A longer one prints as its tokens nest, with the
parentheses that needs. GridCraft's tree walks a left-deep chain in a loop; the printer copied
from craft-xls recurses, which is how the port lost the bound.
- The first cell of a shared or array formula whose BrtShrFmla/BrtArrFmla never comes (another
cell or the next row follows) loses its cell metadata too, as a formula kept as its value does.
The new unit test overflowed its stack without this commit; the extended metadata test fails
without it. The Excel-saved workbook still reads with all 33 formulas as in its .xlsx.
Legacy V3 GDI drivers (HP LaserJet P1102) keep the paper metric in their
DEVMODE extension and report MediaSizeWidth = 0 while the height is right,
so verify_ticket refused with "a paper without a size (a roll?)" and
nothing was sent (storytold/craft-libs#7230).
verify_ticket now fails closed only when neither side is known or the
request itself names no sheet; otherwise it goes on with the requested
size, but only while the side the driver did report agrees with the
request to a quarter of a millimetre. matching_paper gains a partial
record as a candidate of last resort, and driver_ticket takes the wanted
size from the sheet the job asked for, not from the zero record.
The fallback is logged; log moves to the common dependencies so the
warning compiles on Windows too (caught by the windows-gnu check).
With a raised max_pixels on wasm32, a picture could pass every check and
then ask vec! for more than isize::MAX bytes for its scan line or its
float picture, which panics with a capacity overflow instead of returning
an error.
- decode checks the byte count of the scan line and of the float picture
against isize::MAX before allocating either, and returns
LimitExceeded("pixel count") when one is over.
- Each header line is measured as text after invalid bytes become U+FFFD,
and a line over isize::MAX bytes is LimitExceeded("header length").
- The resolution line reads its first four tokens without collecting the
rest.
- The size checks take the bound as a value, and tests check them against
the 32-bit bound without allocating.