Annotation of src/usr.bin/m4/main.c, Revision 1.60
1.60 ! espie 1: /* $OpenBSD: main.c,v 1.59 2003/06/30 21:42:50 espie Exp $ */
1.7 deraadt 2: /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
1.1 deraadt 3:
4: /*-
5: * Copyright (c) 1989, 1993
6: * The Regents of the University of California. All rights reserved.
7: *
8: * This code is derived from software contributed to Berkeley by
9: * Ozan Yigit at York University.
10: *
11: * Redistribution and use in source and binary forms, with or without
12: * modification, are permitted provided that the following conditions
13: * are met:
14: * 1. Redistributions of source code must retain the above copyright
15: * notice, this list of conditions and the following disclaimer.
16: * 2. Redistributions in binary form must reproduce the above copyright
17: * notice, this list of conditions and the following disclaimer in the
18: * documentation and/or other materials provided with the distribution.
1.55 millert 19: * 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 20: * may be used to endorse or promote products derived from this software
21: * without specific prior written permission.
22: *
23: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: * SUCH DAMAGE.
34: */
35:
36: #ifndef lint
37: static char copyright[] =
38: "@(#) Copyright (c) 1989, 1993\n\
39: The Regents of the University of California. All rights reserved.\n";
40: #endif /* not lint */
41:
42: #ifndef lint
43: #if 0
44: static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
45: #else
1.60 ! espie 46: static char rcsid[] = "$OpenBSD: main.c,v 1.59 2003/06/30 21:42:50 espie Exp $";
1.1 deraadt 47: #endif
48: #endif /* not lint */
49:
50: /*
51: * main.c
52: * Facility: m4 macro processor
53: * by: oz
54: */
55:
56: #include <sys/types.h>
1.21 espie 57: #include <assert.h>
1.1 deraadt 58: #include <signal.h>
59: #include <errno.h>
60: #include <unistd.h>
61: #include <stdio.h>
62: #include <ctype.h>
63: #include <string.h>
1.13 espie 64: #include <stddef.h>
1.34 espie 65: #include <stdlib.h>
1.11 espie 66: #include <err.h>
1.1 deraadt 67: #include "mdef.h"
68: #include "stdd.h"
69: #include "extern.h"
70: #include "pathnames.h"
71:
72: ndptr hashtab[HASHSIZE]; /* hash table for macros etc. */
1.34 espie 73: stae *mstack; /* stack of m4 machine */
74: char *sstack; /* shadow stack, for string space extension */
75: static size_t STACKMAX; /* current maximum size of stack */
1.1 deraadt 76: int sp; /* current m4 stack pointer */
77: int fp; /* m4 call frame pointer */
1.26 espie 78: struct input_file infile[MAXINP];/* input file stack (0=stdin) */
1.36 espie 79: FILE **outfile; /* diversion array(0=bitbucket)*/
80: int maxout;
1.1 deraadt 81: FILE *active; /* active output file pointer */
82: int ilevel = 0; /* input file stack pointer */
83: int oindex = 0; /* diversion index.. */
84: char *null = ""; /* as it says.. just a null.. */
85: char *m4wraps = ""; /* m4wrap string default.. */
1.2 deraadt 86: char lquote[MAXCCHARS+1] = {LQUOTE}; /* left quote character (`) */
87: char rquote[MAXCCHARS+1] = {RQUOTE}; /* right quote character (') */
88: char scommt[MAXCCHARS+1] = {SCOMMT}; /* start character for comment */
89: char ecommt[MAXCCHARS+1] = {ECOMMT}; /* end character for comment */
1.54 espie 90: int synch_lines = 0; /* line synchronisation for C preprocessor */
1.1 deraadt 91:
92: struct keyblk keywrds[] = { /* m4 keywords to be installed */
1.8 millert 93: { "include", INCLTYPE },
94: { "sinclude", SINCTYPE },
95: { "define", DEFITYPE },
96: { "defn", DEFNTYPE },
1.24 espie 97: { "divert", DIVRTYPE | NOARGS },
1.8 millert 98: { "expr", EXPRTYPE },
99: { "eval", EXPRTYPE },
100: { "substr", SUBSTYPE },
101: { "ifelse", IFELTYPE },
102: { "ifdef", IFDFTYPE },
103: { "len", LENGTYPE },
104: { "incr", INCRTYPE },
105: { "decr", DECRTYPE },
1.24 espie 106: { "dnl", DNLNTYPE | NOARGS },
107: { "changequote", CHNQTYPE | NOARGS },
108: { "changecom", CHNCTYPE | NOARGS },
1.8 millert 109: { "index", INDXTYPE },
1.1 deraadt 110: #ifdef EXTENDED
1.8 millert 111: { "paste", PASTTYPE },
112: { "spaste", SPASTYPE },
1.31 espie 113: /* Newer extensions, needed to handle gnu-m4 scripts */
114: { "indir", INDIRTYPE},
115: { "builtin", BUILTINTYPE},
116: { "patsubst", PATSTYPE},
117: { "regexp", REGEXPTYPE},
1.35 espie 118: { "esyscmd", ESYSCMDTYPE},
1.31 espie 119: { "__file__", FILENAMETYPE | NOARGS},
120: { "__line__", LINETYPE | NOARGS},
1.1 deraadt 121: #endif
1.8 millert 122: { "popdef", POPDTYPE },
123: { "pushdef", PUSDTYPE },
1.24 espie 124: { "dumpdef", DUMPTYPE | NOARGS },
125: { "shift", SHIFTYPE | NOARGS },
1.8 millert 126: { "translit", TRNLTYPE },
127: { "undefine", UNDFTYPE },
1.24 espie 128: { "undivert", UNDVTYPE | NOARGS },
129: { "divnum", DIVNTYPE | NOARGS },
1.8 millert 130: { "maketemp", MKTMTYPE },
1.24 espie 131: { "errprint", ERRPTYPE | NOARGS },
132: { "m4wrap", M4WRTYPE | NOARGS },
133: { "m4exit", EXITTYPE | NOARGS },
1.8 millert 134: { "syscmd", SYSCTYPE },
1.24 espie 135: { "sysval", SYSVTYPE | NOARGS },
1.49 espie 136: { "traceon", TRACEONTYPE | NOARGS },
137: { "traceoff", TRACEOFFTYPE | NOARGS },
1.1 deraadt 138:
1.24 espie 139: #if defined(unix) || defined(__unix__)
140: { "unix", SELFTYPE | NOARGS },
1.1 deraadt 141: #else
142: #ifdef vms
1.24 espie 143: { "vms", SELFTYPE | NOARGS },
1.1 deraadt 144: #endif
145: #endif
146: };
147:
148: #define MAXKEYS (sizeof(keywrds)/sizeof(struct keyblk))
149:
150: extern int optind;
151: extern char *optarg;
152:
1.27 espie 153: #define MAXRECORD 50
154: static struct position {
155: char *name;
156: unsigned long line;
157: } quotes[MAXRECORD], paren[MAXRECORD];
158:
1.52 millert 159: static void record(struct position *, int);
160: static void dump_stack(struct position *, int);
1.27 espie 161:
1.52 millert 162: static void macro(void);
163: static void initkwds(void);
164: static ndptr inspect(int, char *);
165: static int do_look_ahead(int, const char *);
1.54 espie 166: static void reallyoutputstr(const char *);
167: static void reallyputchar(int);
1.18 espie 168:
1.52 millert 169: static void enlarge_stack(void);
1.34 espie 170:
1.52 millert 171: int main(int, char *[]);
1.1 deraadt 172:
173: int
1.53 espie 174: main(int argc, char *argv[])
1.1 deraadt 175: {
1.17 espie 176: int c;
177: int n;
1.1 deraadt 178: char *p;
179:
180: if (signal(SIGINT, SIG_IGN) != SIG_IGN)
181: signal(SIGINT, onintr);
182:
1.57 espie 183: init_trace();
1.1 deraadt 184: initkwds();
1.14 espie 185: initspaces();
1.34 espie 186: STACKMAX = INITSTACKMAX;
187:
188: mstack = (stae *)xalloc(sizeof(stae) * STACKMAX);
189: sstack = (char *)xalloc(STACKMAX);
1.1 deraadt 190:
1.36 espie 191: maxout = 0;
192: outfile = NULL;
193: resizedivs(MAXOUT);
194:
1.54 espie 195: while ((c = getopt(argc, argv, "gst:d:D:U:o:I:")) != -1)
1.1 deraadt 196: switch(c) {
197:
198: case 'D': /* define something..*/
199: for (p = optarg; *p; p++)
200: if (*p == '=')
201: break;
202: if (*p)
203: *p++ = EOS;
204: dodefine(optarg, p);
1.16 espie 205: break;
206: case 'I':
207: addtoincludepath(optarg);
1.1 deraadt 208: break;
209: case 'U': /* undefine... */
1.59 espie 210: macro_popdef(optarg);
1.32 espie 211: break;
212: case 'g':
213: mimic_gnu = 1;
1.1 deraadt 214: break;
1.46 espie 215: case 'd':
216: set_trace_flags(optarg);
1.47 espie 217: break;
1.54 espie 218: case 's':
219: synch_lines = 1;
220: break;
1.47 espie 221: case 't':
1.49 espie 222: mark_traced(optarg, 1);
1.46 espie 223: break;
1.38 aaron 224: case 'o':
1.46 espie 225: trace_file(optarg);
1.38 aaron 226: break;
1.1 deraadt 227: case '?':
228: usage();
229: }
230:
231: argc -= optind;
232: argv += optind;
233:
234: active = stdout; /* default active output */
235: bbase[0] = bufbase;
236: if (!argc) {
237: sp = -1; /* stack pointer initialized */
238: fp = 0; /* frame pointer initialized */
1.26 espie 239: set_input(infile+0, stdin, "stdin");
240: /* default input (naturally) */
1.1 deraadt 241: macro();
242: } else
243: for (; argc--; ++argv) {
244: p = *argv;
1.13 espie 245: if (p[0] == '-' && p[1] == EOS)
1.26 espie 246: set_input(infile, stdin, "stdin");
247: else if (fopen_trypath(infile, p) == NULL)
1.11 espie 248: err(1, "%s", p);
1.1 deraadt 249: sp = -1;
250: fp = 0;
251: macro();
1.26 espie 252: release_input(infile);
1.1 deraadt 253: }
254:
255: if (*m4wraps) { /* anything for rundown ?? */
256: ilevel = 0; /* in case m4wrap includes.. */
257: bufbase = bp = buf; /* use the entire buffer */
258: pbstr(m4wraps); /* user-defined wrapup act */
259: macro(); /* last will and testament */
260: }
261:
262: if (active != stdout)
263: active = stdout; /* reset output just in case */
1.36 espie 264: for (n = 1; n < maxout; n++) /* default wrap-up: undivert */
1.1 deraadt 265: if (outfile[n] != NULL)
266: getdiv(n);
267: /* remove bitbucket if used */
268: if (outfile[0] != NULL) {
269: (void) fclose(outfile[0]);
270: }
271:
272: return 0;
273: }
274:
275: /*
1.21 espie 276: * Look ahead for `token'.
1.2 deraadt 277: * (on input `t == token[0]')
278: * Used for comment and quoting delimiters.
279: * Returns 1 if `token' present; copied to output.
280: * 0 if `token' not found; all characters pushed back
281: */
1.18 espie 282: static int
1.53 espie 283: do_look_ahead(int t, const char *token)
1.2 deraadt 284: {
285: int i;
286:
1.43 espie 287: assert((unsigned char)t == (unsigned char)token[0]);
1.2 deraadt 288:
289: for (i = 1; *++token; i++) {
290: t = gpbc();
1.43 espie 291: if (t == EOF || (unsigned char)t != (unsigned char)*token) {
1.28 espie 292: putback(t);
1.2 deraadt 293: while (--i)
294: putback(*--token);
295: return 0;
296: }
297: }
298: return 1;
299: }
300:
1.43 espie 301: #define LOOK_AHEAD(t, token) (t != EOF && \
302: (unsigned char)(t)==(unsigned char)(token)[0] && \
303: do_look_ahead(t,token))
1.2 deraadt 304:
305: /*
1.1 deraadt 306: * macro - the work horse..
307: */
1.18 espie 308: static void
1.56 deraadt 309: macro(void)
1.17 espie 310: {
1.34 espie 311: char token[MAXTOK+1];
1.17 espie 312: int t, l;
313: ndptr p;
314: int nlpar;
1.1 deraadt 315:
316: cycle {
1.2 deraadt 317: t = gpbc();
318: if (t == '_' || isalpha(t)) {
1.29 espie 319: p = inspect(t, token);
1.59 espie 320: if (p != NULL)
1.24 espie 321: putback(l = gpbc());
1.59 espie 322: if (p == NULL || (l != LPAREN &&
323: (macro_getdef(p)->type & NEEDARGS) != 0))
1.29 espie 324: outputstr(token);
1.1 deraadt 325: else {
326: /*
327: * real thing.. First build a call frame:
328: */
329: pushf(fp); /* previous call frm */
1.59 espie 330: pushf(macro_getdef(p)->type); /* type of the call */
1.60 ! espie 331: if (traced_macros && is_traced(macro_name(p)))
! 332: pushf(1);
! 333: else
! 334: pushf(0);
1.1 deraadt 335: pushf(0); /* parenthesis level */
336: fp = sp; /* new frame pointer */
337: /*
338: * now push the string arguments:
339: */
1.59 espie 340: pushs1(macro_getdef(p)->defn); /* defn string */
341: pushs1((char *)macro_name(p)); /* macro name */
1.34 espie 342: pushs(ep); /* start next..*/
1.1 deraadt 343:
1.41 espie 344: if (l != LPAREN && PARLEV == 0) {
345: /* no bracks */
346: chrsave(EOS);
347:
348: if (sp == STACKMAX)
349: errx(1, "internal stack overflow");
1.44 espie 350: eval((const char **) mstack+fp+1, 2,
1.60 ! espie 351: CALTYP, TRACESTATUS);
1.41 espie 352:
353: ep = PREVEP; /* flush strspace */
354: sp = PREVSP; /* previous sp.. */
355: fp = PREVFP; /* rewind stack...*/
1.1 deraadt 356: }
357: }
1.41 espie 358: } else if (t == EOF) {
1.27 espie 359: if (sp > -1) {
360: warnx( "unexpected end of input, unclosed parenthesis:");
361: dump_stack(paren, PARLEV);
362: exit(1);
363: }
1.1 deraadt 364: if (ilevel <= 0)
365: break; /* all done thanks.. */
1.26 espie 366: release_input(infile+ilevel--);
1.54 espie 367: emit_synchline();
1.1 deraadt 368: bufbase = bbase[ilevel];
369: continue;
370: }
371: /*
1.7 deraadt 372: * non-alpha token possibly seen..
1.1 deraadt 373: * [the order of else if .. stmts is important.]
374: */
1.2 deraadt 375: else if (LOOK_AHEAD(t,lquote)) { /* strip quotes */
1.27 espie 376: nlpar = 0;
377: record(quotes, nlpar++);
1.30 espie 378: /*
379: * Opening quote: scan forward until matching
380: * closing quote has been found.
381: */
1.1 deraadt 382: do {
1.7 deraadt 383:
1.2 deraadt 384: l = gpbc();
1.7 deraadt 385: if (LOOK_AHEAD(l,rquote)) {
1.29 espie 386: if (--nlpar > 0)
387: outputstr(rquote);
1.7 deraadt 388: } else if (LOOK_AHEAD(l,lquote)) {
1.27 espie 389: record(quotes, nlpar++);
1.29 espie 390: outputstr(lquote);
1.17 espie 391: } else if (l == EOF) {
392: if (nlpar == 1)
1.27 espie 393: warnx("unclosed quote:");
1.17 espie 394: else
1.27 espie 395: warnx("%d unclosed quotes:", nlpar);
396: dump_stack(quotes, nlpar);
397: exit(1);
1.17 espie 398: } else {
1.29 espie 399: if (nlpar > 0) {
400: if (sp < 0)
1.54 espie 401: reallyputchar(l);
1.29 espie 402: else
1.48 espie 403: CHRSAVE(l);
1.29 espie 404: }
1.7 deraadt 405: }
1.1 deraadt 406: }
407: while (nlpar != 0);
408: }
409:
1.2 deraadt 410: else if (sp < 0 && LOOK_AHEAD(t, scommt)) {
1.54 espie 411: reallyoutputstr(scommt);
1.2 deraadt 412:
413: for(;;) {
414: t = gpbc();
415: if (LOOK_AHEAD(t, ecommt)) {
1.54 espie 416: reallyoutputstr(ecommt);
1.2 deraadt 417: break;
418: }
419: if (t == EOF)
420: break;
1.54 espie 421: reallyputchar(t);
1.1 deraadt 422: }
1.2 deraadt 423: }
424:
425: else if (sp < 0) { /* not in a macro at all */
1.54 espie 426: reallyputchar(t); /* output directly.. */
1.1 deraadt 427: }
428:
429: else switch(t) {
430:
431: case LPAREN:
432: if (PARLEV > 0)
433: chrsave(t);
434: while (isspace(l = gpbc()))
435: ; /* skip blank, tab, nl.. */
436: putback(l);
1.27 espie 437: record(paren, PARLEV++);
1.1 deraadt 438: break;
439:
440: case RPAREN:
441: if (--PARLEV > 0)
442: chrsave(t);
443: else { /* end of argument list */
444: chrsave(EOS);
445:
446: if (sp == STACKMAX)
1.11 espie 447: errx(1, "internal stack overflow");
1.1 deraadt 448:
1.44 espie 449: eval((const char **) mstack+fp+1, sp-fp,
1.60 ! espie 450: CALTYP, TRACESTATUS);
1.1 deraadt 451:
452: ep = PREVEP; /* flush strspace */
453: sp = PREVSP; /* previous sp.. */
454: fp = PREVFP; /* rewind stack...*/
455: }
456: break;
457:
458: case COMMA:
459: if (PARLEV == 1) {
460: chrsave(EOS); /* new argument */
461: while (isspace(l = gpbc()))
462: ;
463: putback(l);
464: pushs(ep);
465: } else
466: chrsave(t);
467: break;
468:
469: default:
1.22 espie 470: if (LOOK_AHEAD(t, scommt)) {
471: char *p;
472: for (p = scommt; *p; p++)
473: chrsave(*p);
474: for(;;) {
475: t = gpbc();
476: if (LOOK_AHEAD(t, ecommt)) {
477: for (p = ecommt; *p; p++)
478: chrsave(*p);
479: break;
480: }
481: if (t == EOF)
482: break;
1.48 espie 483: CHRSAVE(t);
1.22 espie 484: }
485: } else
1.48 espie 486: CHRSAVE(t); /* stack the char */
1.1 deraadt 487: break;
488: }
489: }
490: }
491:
1.24 espie 492: /*
493: * output string directly, without pushing it for reparses.
494: */
495: void
1.53 espie 496: outputstr(const char *s)
1.24 espie 497: {
498: if (sp < 0)
1.54 espie 499: reallyoutputstr(s);
1.24 espie 500: else
501: while (*s)
1.48 espie 502: CHRSAVE(*s++);
1.24 espie 503: }
504:
1.54 espie 505: void
506: reallyoutputstr(const char *s)
507: {
508: if (synch_lines) {
509: while (*s) {
510: fputc(*s, active);
511: if (*s++ == '\n') {
512: infile[ilevel].synch_lineno++;
513: if (infile[ilevel].synch_lineno !=
514: infile[ilevel].lineno)
515: do_emit_synchline();
516: }
517: }
518: } else
519: fputs(s, active);
520: }
521:
522: void
523: reallyputchar(int c)
524: {
525: putc(c, active);
526: if (synch_lines && c == '\n') {
527: infile[ilevel].synch_lineno++;
528: if (infile[ilevel].synch_lineno != infile[ilevel].lineno)
529: do_emit_synchline();
530: }
531: }
532:
1.1 deraadt 533: /*
534: * build an input token..
1.59 espie 535: * consider only those starting with _ or A-Za-z.
1.1 deraadt 536: */
1.18 espie 537: static ndptr
1.53 espie 538: inspect(int c, char *tp)
1.1 deraadt 539: {
1.17 espie 540: char *name = tp;
541: char *etp = tp+MAXTOK;
542: ndptr p;
1.25 espie 543: unsigned int h;
544:
1.59 espie 545: *tp++ = c;
1.1 deraadt 546:
547: while ((isalnum(c = gpbc()) || c == '_') && tp < etp)
1.59 espie 548: *tp++ = c;
1.51 espie 549: if (c != EOF)
550: PUTBACK(c);
1.1 deraadt 551: *tp = EOS;
1.33 espie 552: /* token is too long, it won't match anything, but it can still
553: * be output. */
554: if (tp == ep) {
555: outputstr(name);
556: while (isalnum(c = gpbc()) || c == '_') {
557: if (sp < 0)
1.54 espie 558: reallyputchar(c);
1.33 espie 559: else
1.48 espie 560: CHRSAVE(c);
1.33 espie 561: }
562: *name = EOS;
1.59 espie 563: return NULL;
1.33 espie 564: }
1.1 deraadt 565:
1.59 espie 566: return lookup(name);
1.1 deraadt 567: }
568:
569: /*
570: * initkwds - initialise m4 keywords as fast as possible.
571: * This very similar to install, but without certain overheads,
572: * such as calling lookup. Malloc is not used for storing the
1.17 espie 573: * keyword strings, since we simply use the static pointers
1.1 deraadt 574: * within keywrds block.
575: */
1.18 espie 576: static void
1.56 deraadt 577: initkwds(void)
1.17 espie 578: {
1.59 espie 579: unsigned int type;
580: int i;
1.1 deraadt 581:
582: for (i = 0; i < MAXKEYS; i++) {
1.59 espie 583: type = keywrds[i].ktyp & TYPEMASK;
1.24 espie 584: if ((keywrds[i].ktyp & NOARGS) == 0)
1.59 espie 585: type |= NEEDARGS;
586: setup_builtin(keywrds[i].knam, type);
1.1 deraadt 587: }
588: }
1.31 espie 589:
590: /* Look up a builtin type, even if overridden by the user */
591: int
1.53 espie 592: builtin_type(const char *key)
1.31 espie 593: {
594: int i;
595:
596: for (i = 0; i != MAXKEYS; i++)
597: if (STREQ(keywrds[i].knam, key))
598: return keywrds[i].ktyp;
599: return -1;
1.45 espie 600: }
1.17 espie 601:
1.27 espie 602: static void
1.53 espie 603: record(struct position *t, int lev)
1.27 espie 604: {
605: if (lev < MAXRECORD) {
606: t[lev].name = CURRENT_NAME;
607: t[lev].line = CURRENT_LINE;
608: }
609: }
610:
611: static void
1.53 espie 612: dump_stack(struct position *t, int lev)
1.27 espie 613: {
614: int i;
615:
616: for (i = 0; i < lev; i++) {
617: if (i == MAXRECORD) {
618: fprintf(stderr, " ...\n");
619: break;
620: }
621: fprintf(stderr, " %s at line %lu\n",
622: t[i].name, t[i].line);
623: }
1.34 espie 624: }
625:
626:
627: static void
1.56 deraadt 628: enlarge_stack(void)
1.34 espie 629: {
630: STACKMAX *= 2;
631: mstack = realloc(mstack, sizeof(stae) * STACKMAX);
632: sstack = realloc(sstack, STACKMAX);
633: if (mstack == NULL || sstack == NULL)
634: errx(1, "Evaluation stack overflow (%lu)",
635: (unsigned long)STACKMAX);
1.27 espie 636: }