9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] Bug in rc
@ 2023-04-26 18:20 Yury Chumak
  2023-04-27  0:44 ` ori
  0 siblings, 1 reply; 5+ messages in thread
From: Yury Chumak @ 2023-04-26 18:20 UTC (permalink / raw)
  To: 9front

Hello all..

Noticed that rc returns error 'stack overflow' if code consists
'switch' construction with big amount of 'case' blocks. Steps to
reproduce:

1.Generate test script by next code:
#!/bin/rc
echo '#!/bin/rc' >test.rc
echo 'switch($*){' >>test.rc
for(i in `{seq 1 250}){
    echo ' case ' $i>>test.rc
    echo '    echo number ' $i>>test.rc
}
echo ' case *' >>test.rc
echo '    echo number none'>>test.rc
echo '}'>>test.rc

2. Run result script:
% chmod +x test.rc
% test.rc
./test.rc:497: token 248: yacc stack overflow

The 'switch' construction works normaly with number 'case' block less than 247.
In comparison linux's bash has no limitation to number elements in
'case' block (at least 500k tested).


-- 
Sphynkx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-27  9:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 18:20 [9front] Bug in rc Yury Chumak
2023-04-27  0:44 ` ori
2023-04-27  2:05   ` Yury Chumak
2023-04-27  2:15   ` Anthony Martin
2023-04-27  3:09     ` Yury Chumak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).