Files
Behdad EsfahbodandClaude Opus 5.5 2f641844f2 [subset] Stop CFF subr walks at the call-depth limit instead of failing
The hint-dropping and subr-closure walks enforce kMaxCallLimit
themselves, because the recorded call graph can nest deeper than the
interpreter allows or be cyclic.  Hitting the limit failed the whole
subset, and the hint-dropping walk signalled it by writing -1 into the
shared work budget, conflating "too deep" with "out of budget" and
clobbering the budget for later passes.

Make both walks best-effort at the limit: the closure walk keeps the
subr it reached but does not walk into it, and the hint-dropping walk
does not walk into the subr and keeps the call and its hints.  Only
running out of the work budget fails the subset now, so
drop_hints_param_t no longer needs set_error() and the budget is only
ever touched by hb_budget_spend().  Walks that follow the
interpreter's path never reach the limit, so real fonts are
unaffected; for fonts whose records diverge the output may keep a few
hints or call a subr whose callees were not retained, but no longer
fails.

test_subset_cff1_subr_loop now also asserts that the subset succeeds;
it failed before this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:25:04 -06:00
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00