Skip to main content

PS_STACK_LIMIT

Constant PS_STACK_LIMIT 

Source
pub const PS_STACK_LIMIT: usize = 100;
Expand description

Operand-stack capacity for a type 4 program — a spec value, not policy.

§7.10.5.1: “Implementations of type 4 functions shall provide a stack with room for at least 100 entries. No implementation shall be required to provide a larger stack, and it shall be an error to overflow the stack.”

Both halves matter. 100 is a floor pdfcer must meet, and it is simultaneously a ceiling pdfcer is entitled to stop at — so overflowing at exactly 100 with FunctionError::StackOverflow is conformant behaviour, not a limitation. A program that needs 101 entries is malformed by the standard’s own definition; accommodating it would mean silently accepting files that no other conforming reader accepts.