looking at /sys/src/cmd/cc/cc.h reminded me to note that in the app you can
#define YYMAXDEPTH before /sys/lib/yaccpar is copied in, and it #ifdefs the
YYMAXDEPTH value built into yacc

On Fri, 8 Aug 2025 at 19:04, Charles Forsyth <[email protected]>
wrote:

> That's indeed usually the case. it's amusing that top down hates left
> recursion and bottom up hates right recursion (but it can cope), for
> similar reasons, different ends of a mathematical equator.
> Unfortunately I don't remember which thing failing prompted the
> increase for the Limbo version, but I suspect it was nested parenthesised
> expressions in a stress tester or similar,
> where given ( e it wanted to wait for the punchline. /sys/src/cmd/cc/cc.h
> defines YYMAXDEPTH to 1500 perhaps for a similar reason.
>
>
> On Fri, 8 Aug 2025 at 16:28, Bruce Ellis <[email protected]> wrote:
>
>> If you are blowing YYMAXDEPTH then you have a poor grammar specification.
>>
>> Items : items item
>>
>> Is good.
>>
>> Items : item items
>>
>> Is poor.
>>
>> On Thu, 7 Aug 2025, 5:40 am , <[email protected]> wrote:
>>
>>> Quoth Anthony Sorace <[email protected]>:
>>> > I've just run into awk code where yacc's default YYMAXDEPTH of 150
>>> causes stack exhaustion; increasing it lets the code work fine. It's been
>>> 150 since at least v7 Unix (I didn't have earlier on hand to check), and
>>> our systems are a little bigger now; it seems safe to bump up quite a bit.
>>> >
>>> > Is anyone aware of yacc-generated code which uses this value as a
>>> check, rather than just being the more obvious guard against using too much
>>> system resources?
>>> >
>>> >
>>> 
>>> I don't think anything would notice. Do you have an example of code that
>>> causes an issue?
>>> 
>> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
>> <https://9fans.topicbox.com/groups/9fans> + participants
>> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
>> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
>> <https://9fans.topicbox.com/groups/9fans/Td74874a3700432ac-M162a320121497030076cce59>
>>

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Td74874a3700432ac-M77e4373ad8702600bda0e1e4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to