Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Guy Harris
Sat, 10 Jan 1987 05:12
"awk" drops core on many syntax errors
Author: Guy Harris
Date: Sat, 10 Jan 1987 05:12
Date: Sat, 10 Jan 1987 05:12
55 lines
2115 bytes
2115 bytes
Index: cmd/awk/awk.g.y
Description:
In a number of cases, "awk" will drop core when it encounters
a syntax error. If "awk"s standard error is redirected to a
file, it may not even print the error messages.
Repeat-By:
Run the following command:
awk '{ ng[] = ; goop = 1; }' </dev/null
and watch it drop core.
Fix:
*** /tmp/da7722 Fri Jan 9 21:09:43 1987
--- awk.g.y Fri Jan 9 21:00:22 1987
***************
*** 238,244 ****
{ $$ = stat3($1, $2, 0, 0); }
| expr { $$ = exptostat($1); }
| { $$ = (int)0; }
! | error { yyclearin; yyerror("illegal statement"); }
;
statement:
--- 238,244 ----
{ $$ = stat3($1, $2, 0, 0); }
| expr { $$ = exptostat($1); }
| { $$ = (int)0; }
! | error { yyclearin; yyerror("illegal statement"); $$ = (int)0; }
;
statement:
For those of you with S5R1 and its older version of "awk", the change is the
same; only some of the surrounding code differs.
*** /arch/4.3/usr/src/bin/awk/awk.g.y Sun Feb 27 14:24:47 1983
--- ./awk.g.y Fri Jan 9 21:01:29 1987
***************
*** 235,241 ****
{ PUTS("printf list"); $$ = stat3($1, $2, nullstat, nullstat); }
| expr { PUTS("expr"); $$ = exptostat($1); }
| { PUTS("null simple statement"); $$ = (hack)nullstat; }
! | error { yyclearin; yyerror("illegal statement"); }
;
statement:
--- 235,241 ----
{ PUTS("printf list"); $$ = stat3($1, $2, nullstat, nullstat); }
| expr { PUTS("expr"); $$ = exptostat($1); }
| { PUTS("null simple statement"); $$ = (hack)nullstat; }
! | error { yyclearin; yyerror("illegal statement"); $$ = (hack)nullstat; }
;
statement:
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads