Repository navigation
Bound the work and recursion depth of PostScript Type 4 compilation - #22231
Merged
Merged
Conversation
Contributor
Viewer preview🗑️ Viewer previews removed. |
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 18, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22231 +/- ##
==========================================
+ Coverage 90.44% 90.46% +0.01%
==========================================
Files 277 277
Lines 68216 68243 +27
==========================================
+ Hits 61699 61734 +35
+ Misses 6517 6509 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
timvandermeij
approved these changes
Oct 18, 2026
timvandermeij
left a comment
Collaborator
There was a problem hiding this comment.
r=me, with the comment addressed. Thanks!
calixteman
force-pushed
the
ps-tree-work-budget
branch
from
October 18, 2026 18:34
0d69b76 to
30165d9
Compare
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 18, 2026
Stack-growing `if` forks and comparisons of distinct DAGs can take exponential work. Limit instruction and comparison work and fork depth; the JS builder uses the interpreter when conversion exceeds a limit.
Cap expression depth to bound recursive comparison, sharing analysis and code generation. The JS builder interprets deeper expressions. Reject excessive procedure nesting during parsing.
calixteman
force-pushed
the
ps-tree-work-budget
branch
from
October 18, 2026 18:36
30165d9 to
9815e4e
Compare
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 18, 2026
Contributor
Reference testsResults for 9815e4e (run, references from mozilla/pdf.js.refs@fce2c7a732).
The report is kept for 30 days and replaced by the next run. |
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 18, 2026
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 18, 2026
This was referenced Nov 3, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some Type 4 functions take exponential time or overflow the stack when converted to a tree: chains of ifs that change the stack depth, comparisons of identical but separate DAGs (dup mul chains), and very deep nesting or expressions.
This PR adds an instruction/comparison work budget and limits fork depth, expression depth and procedure nesting. Functions that hit a limit fall back to PSStackBasedInterpreter, except nesting that is too deep, which the parser rejects.