1 /* Parse C expressions for CCCP.
2 Copyright (C) 1987, 1992, 1994, 1995, 1997, 1998 Free Software Foundation.
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
19 In other words, you are welcome to use, share and improve this program.
20 You are forbidden to forbid anyone else to use, share and improve
21 what you give them. Help stamp out software-hoarding!
23 Written by Per Bothner 1994. */
25 /* Parse a C expression from text in a string */
29 #include "gansidecl.h"
32 extern char *xmalloc
PARAMS ((unsigned));
33 extern char *xrealloc
PARAMS ((void *, unsigned));
35 #ifdef MULTIBYTE_CHARS
39 /* This is used for communicating lists of keywords with cccp.c. */
47 #ifndef CHAR_TYPE_SIZE
48 #define CHAR_TYPE_SIZE BITS_PER_UNIT
52 #define INT_TYPE_SIZE BITS_PER_WORD
55 #ifndef LONG_TYPE_SIZE
56 #define LONG_TYPE_SIZE BITS_PER_WORD
59 #ifndef WCHAR_TYPE_SIZE
60 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
63 #ifndef MAX_CHAR_TYPE_SIZE
64 #define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE
67 #ifndef MAX_INT_TYPE_SIZE
68 #define MAX_INT_TYPE_SIZE INT_TYPE_SIZE
71 #ifndef MAX_LONG_TYPE_SIZE
72 #define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE
75 #ifndef MAX_WCHAR_TYPE_SIZE
76 #define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
79 /* Yield nonzero if adding two numbers with A's and B's signs can yield a
80 number with SUM's sign, where A, B, and SUM are all C integers. */
81 #define possible_sum_sign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0)
83 static void integer_overflow
PARAMS ((cpp_reader
*));
84 static long left_shift
PARAMS ((cpp_reader
*, long, int, unsigned long));
85 static long right_shift
PARAMS ((cpp_reader
*, long, int, unsigned long));
100 #define LEFT_OPERAND_REQUIRED 1
101 #define RIGHT_OPERAND_REQUIRED 2
103 /* SKIP_OPERAND is set for '&&' '||' '?' and ':' when the
104 following operand should be short-circuited instead of evaluated. */
105 #define SKIP_OPERAND 8
106 /*#define UNSIGNEDP 16*/
108 /* Find the largest host integer type and set its size and type.
109 Watch out: on some crazy hosts `long' is shorter than `int'. */
111 #ifndef HOST_WIDE_INT
113 # include <inttypes.h>
114 # define HOST_WIDE_INT intmax_t
116 # if (HOST_BITS_PER_LONG <= HOST_BITS_PER_INT \
117 && HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_INT)
118 # define HOST_WIDE_INT int
120 # if (HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_LONG \
121 || ! (defined LONG_LONG_MAX || defined LLONG_MAX))
122 # define HOST_WIDE_INT long
124 # define HOST_WIDE_INT long long
134 #ifndef HOST_BITS_PER_WIDE_INT
135 #define HOST_BITS_PER_WIDE_INT (CHAR_BIT * sizeof (HOST_WIDE_INT))
140 char rprio
; /* Priority of op (relative to it right operand). */
142 char unsignedp
; /* true if value should be treated as unsigned */
143 HOST_WIDE_INT value
; /* The value logically "right" of op. */
146 /* Take care of parsing a number (anything that starts with a digit).
147 LEN is the number of characters in it. */
149 /* maybe needs to actually deal with floating point numbers */
152 parse_number (pfile
, start
, olen
)
158 register char *p
= start
;
160 register unsigned long n
= 0, nd
, ULONG_MAX_over_base
;
161 register int base
= 10;
162 register int len
= olen
;
163 register int overflow
= 0;
164 register int digit
, largest_digit
= 0;
169 for (c
= 0; c
< len
; c
++)
171 /* It's a float since it contains a point. */
173 "floating point numbers not allowed in #if expressions");
178 if (len
>= 3 && (!strncmp (p
, "0x", 2) || !strncmp (p
, "0X", 2))) {
186 /* Some buggy compilers (e.g. MPW C) seem to need both casts. */
187 ULONG_MAX_over_base
= ((unsigned long) -1) / ((unsigned long) base
);
189 for (; len
> 0; len
--) {
192 if (c
>= '0' && c
<= '9')
194 else if (base
== 16 && c
>= 'a' && c
<= 'f')
195 digit
= c
- 'a' + 10;
196 else if (base
== 16 && c
>= 'A' && c
<= 'F')
197 digit
= c
- 'A' + 10;
199 /* `l' means long, and `u' means unsigned. */
201 if (c
== 'l' || c
== 'L')
204 cpp_error (pfile
, "two `l's in integer constant");
207 else if (c
== 'u' || c
== 'U')
210 cpp_error (pfile
, "two `u's in integer constant");
220 /* Don't look for any more digits after the suffixes. */
223 if (largest_digit
< digit
)
224 largest_digit
= digit
;
225 nd
= n
* base
+ digit
;
226 overflow
|= ULONG_MAX_over_base
< n
|| nd
< n
;
232 cpp_error (pfile
, "Invalid number in #if expression");
237 if (base
<= largest_digit
)
238 cpp_pedwarn (pfile
, "integer constant contains digits beyond the radix");
241 cpp_pedwarn (pfile
, "integer constant out of range");
243 /* If too big to be signed, consider it unsigned. */
244 if ((long) n
< 0 && ! op
.unsignedp
)
247 cpp_warning (pfile
, "integer constant is so large that it is unsigned");
261 static struct token tokentab2
[] = {
275 /* Read one token. */
278 cpp_lex (pfile
, skip_evaluation
)
283 register struct token
*toktab
;
284 enum cpp_token token
;
286 U_CHAR
*tok_start
, *tok_end
;
291 old_written
= CPP_WRITTEN (pfile
);
292 cpp_skip_hspace (pfile
);
293 c
= CPP_BUF_PEEK (CPP_BUFFER (pfile
));
295 return parse_number (pfile
,
296 cpp_read_check_assertion (pfile
) ? "1" : "0", 1);
304 token
= cpp_get_token (pfile
);
305 tok_start
= pfile
->token_buffer
+ old_written
;
306 tok_end
= CPP_PWRITTEN (pfile
);
307 pfile
->limit
= tok_start
;
310 case CPP_EOF
: /* Should not happen ... */
315 if (CPP_BUFFER (pfile
)->fname
!= NULL
)
320 cpp_pop_buffer (pfile
);
322 case CPP_HSPACE
: case CPP_COMMENT
:
325 return parse_number (pfile
, tok_start
, tok_end
- tok_start
);
327 cpp_error (pfile
, "string constants not allowed in #if expressions");
331 /* This code for reading a character constant
332 handles multicharacter constants and wide characters.
333 It is mostly copied from c-lex.c. */
335 register int result
= 0;
336 register int num_chars
= 0;
337 unsigned width
= MAX_CHAR_TYPE_SIZE
;
340 U_CHAR
*ptr
= tok_start
;
341 #ifdef MULTIBYTE_CHARS
342 char token_buffer
[MAX_LONG_TYPE_SIZE
/MAX_CHAR_TYPE_SIZE
+ MB_CUR_MAX
];
344 char token_buffer
[MAX_LONG_TYPE_SIZE
/MAX_CHAR_TYPE_SIZE
+ 1];
351 width
= MAX_WCHAR_TYPE_SIZE
;
352 #ifdef MULTIBYTE_CHARS
353 max_chars
= MB_CUR_MAX
;
359 max_chars
= MAX_LONG_TYPE_SIZE
/ width
;
362 while (ptr
< tok_end
&& ((c
= *ptr
++) != '\''))
366 c
= cpp_parse_escape (pfile
, (char **) &ptr
);
367 if (width
< HOST_BITS_PER_INT
368 && (unsigned) c
>= (unsigned)(1 << width
))
370 "escape sequence out of range for character");
375 /* Merge character into result; ignore excess chars. */
376 if (num_chars
< max_chars
+ 1)
378 if (width
< HOST_BITS_PER_INT
)
379 result
= (result
<< width
) | (c
& ((1 << width
) - 1));
382 token_buffer
[num_chars
- 1] = c
;
386 token_buffer
[num_chars
] = 0;
389 cpp_error (pfile
, "malformatted character constant");
390 else if (num_chars
== 0)
391 cpp_error (pfile
, "empty character constant");
392 else if (num_chars
> max_chars
)
394 num_chars
= max_chars
;
395 cpp_error (pfile
, "character constant too long");
397 else if (num_chars
!= 1 && ! CPP_TRADITIONAL (pfile
))
398 cpp_warning (pfile
, "multi-character character constant");
400 /* If char type is signed, sign-extend the constant. */
403 int num_bits
= num_chars
* width
;
405 if (cpp_lookup (pfile
, (U_CHAR
*)"__CHAR_UNSIGNED__",
406 sizeof ("__CHAR_UNSIGNED__")-1, -1)
407 || ((result
>> (num_bits
- 1)) & 1) == 0)
409 = result
& ((unsigned long) ~0 >> (HOST_BITS_PER_LONG
- num_bits
));
412 = result
| ~((unsigned long) ~0 >> (HOST_BITS_PER_LONG
- num_bits
));
416 #ifdef MULTIBYTE_CHARS
417 /* Set the initial shift state and convert the next sequence. */
419 /* In all locales L'\0' is zero and mbtowc will return zero,
422 || (num_chars
== 1 && token_buffer
[0] != '\0'))
425 (void) mbtowc (NULL_PTR
, NULL_PTR
, 0);
426 if (mbtowc (& wc
, token_buffer
, num_chars
) == num_chars
)
429 cpp_pedwarn (pfile
,"Ignoring invalid multibyte character");
436 /* This is always a signed type. */
443 if (CPP_WARN_UNDEF (pfile
) && !skip_evaluation
)
444 cpp_warning (pfile
, "`%.*s' is not defined",
445 (int) (tok_end
- tok_start
), tok_start
);
446 return parse_number (pfile
, "0", 0);
449 /* See if it is a special token of length 2. */
450 if (tok_start
+ 2 == tok_end
)
452 for (toktab
= tokentab2
; toktab
->operator != NULL
; toktab
++)
453 if (tok_start
[0] == toktab
->operator[0]
454 && tok_start
[1] == toktab
->operator[1])
456 if (toktab
->token
== ERROR
)
458 char *buf
= (char *) alloca (40);
459 sprintf (buf
, "`%s' not allowed in operand of `#if'", tok_start
);
460 cpp_error (pfile
, buf
);
462 op
.op
= toktab
->token
;
473 /* Parse a C escape sequence. STRING_PTR points to a variable
474 containing a pointer to the string to parse. That pointer
475 is updated past the characters we use. The value of the
476 escape sequence is returned.
478 A negative value means the sequence \ newline was seen,
479 which is supposed to be equivalent to nothing at all.
481 If \ is followed by a null character, we return a negative
482 value and leave the string pointer pointing at the null character.
484 If \ is followed by 000, we return 0 and leave the string pointer
485 after the zeros. A value of 0 does not mean end of string. */
488 cpp_parse_escape (pfile
, string_ptr
)
492 register int c
= *(*string_ptr
)++;
501 if (CPP_PEDANTIC (pfile
))
502 cpp_pedwarn (pfile
, "non-ANSI-standard escape sequence, `\\%c'", c
);
507 return TARGET_NEWLINE
;
529 register int i
= c
- '0';
530 register int count
= 0;
533 c
= *(*string_ptr
)++;
534 if (c
>= '0' && c
<= '7')
535 i
= (i
<< 3) + c
- '0';
542 if ((i
& ~((1 << MAX_CHAR_TYPE_SIZE
) - 1)) != 0)
544 i
&= (1 << MAX_CHAR_TYPE_SIZE
) - 1;
546 "octal character constant does not fit in a byte");
552 register unsigned i
= 0, overflow
= 0, digits_found
= 0, digit
;
555 c
= *(*string_ptr
)++;
556 if (c
>= '0' && c
<= '9')
558 else if (c
>= 'a' && c
<= 'f')
559 digit
= c
- 'a' + 10;
560 else if (c
>= 'A' && c
<= 'F')
561 digit
= c
- 'A' + 10;
567 overflow
|= i
^ (i
<< 4 >> 4);
568 i
= (i
<< 4) + digit
;
572 cpp_error (pfile
, "\\x used with no following hex digits");
573 if (overflow
| (i
& ~((1 << BITS_PER_UNIT
) - 1)))
575 i
&= (1 << BITS_PER_UNIT
) - 1;
577 "hex character constant does not fit in a byte");
587 integer_overflow (pfile
)
590 if (CPP_PEDANTIC (pfile
))
591 cpp_pedwarn (pfile
, "integer overflow in preprocessor expression");
595 left_shift (pfile
, a
, unsignedp
, b
)
601 if (b
>= HOST_BITS_PER_LONG
)
603 if (! unsignedp
&& a
!= 0)
604 integer_overflow (pfile
);
608 return (unsigned long) a
<< b
;
613 integer_overflow (pfile
);
619 right_shift (pfile
, a
, unsignedp
, b
)
620 cpp_reader
*pfile ATTRIBUTE_UNUSED
;
625 if (b
>= HOST_BITS_PER_LONG
)
626 return unsignedp
? 0 : a
>> (HOST_BITS_PER_LONG
- 1);
628 return (unsigned long) a
>> b
;
633 /* These priorities are all even, so we can handle associatively. */
634 #define PAREN_INNER_PRIO 0
636 #define COND_PRIO (COMMA_PRIO+2)
637 #define OROR_PRIO (COND_PRIO+2)
638 #define ANDAND_PRIO (OROR_PRIO+2)
639 #define OR_PRIO (ANDAND_PRIO+2)
640 #define XOR_PRIO (OR_PRIO+2)
641 #define AND_PRIO (XOR_PRIO+2)
642 #define EQUAL_PRIO (AND_PRIO+2)
643 #define LESS_PRIO (EQUAL_PRIO+2)
644 #define SHIFT_PRIO (LESS_PRIO+2)
645 #define PLUS_PRIO (SHIFT_PRIO+2)
646 #define MUL_PRIO (PLUS_PRIO+2)
647 #define UNARY_PRIO (MUL_PRIO+2)
648 #define PAREN_OUTER_PRIO (UNARY_PRIO+2)
650 #define COMPARE(OP) \
652 top->value = (unsigned1 || unsigned2) \
653 ? (unsigned long) v1 OP (unsigned long) v2 : (v1 OP v2)
655 /* Parse and evaluate a C expression, reading from PFILE.
656 Returns the value of the expression. */
659 cpp_parse_expr (pfile
)
662 /* The implementation is an operator precedence parser,
663 i.e. a bottom-up parser, using a stack for not-yet-reduced tokens.
665 The stack base is 'stack', and the current stack pointer is 'top'.
666 There is a stack element for each operator (only),
667 and the most recently pushed operator is 'top->op'.
668 An operand (value) is stored in the 'value' field of the stack
669 element of the operator that precedes it.
670 In that case the 'flags' field has the HAVE_VALUE flag set. */
672 #define INIT_STACK_SIZE 20
673 struct operation init_stack
[INIT_STACK_SIZE
];
674 struct operation
*stack
= init_stack
;
675 struct operation
*limit
= stack
+ INIT_STACK_SIZE
;
676 register struct operation
*top
= stack
;
678 int skip_evaluation
= 0;
688 op
= cpp_lex (pfile
, skip_evaluation
);
690 /* See if the token is an operand, in which case go to set_value.
691 If the token is an operator, figure out its left and right
692 priorities, and then goto maybe_reduce. */
699 top
->value
= op
.value
;
700 top
->unsignedp
= op
.unsignedp
;
703 lprio
= 0; goto maybe_reduce
;
705 /* Is this correct if unary ? FIXME */
706 flags
= RIGHT_OPERAND_REQUIRED
;
707 lprio
= PLUS_PRIO
; rprio
= lprio
+ 1; goto maybe_reduce
;
709 flags
= RIGHT_OPERAND_REQUIRED
;
710 rprio
= UNARY_PRIO
; lprio
= rprio
+ 1; goto maybe_reduce
;
711 case '*': case '/': case '%':
712 lprio
= MUL_PRIO
; goto binop
;
713 case '<': case '>': case LEQ
: case GEQ
:
714 lprio
= LESS_PRIO
; goto binop
;
715 case EQUAL
: case NOTEQUAL
:
716 lprio
= EQUAL_PRIO
; goto binop
;
718 lprio
= SHIFT_PRIO
; goto binop
;
719 case '&': lprio
= AND_PRIO
; goto binop
;
720 case '^': lprio
= XOR_PRIO
; goto binop
;
721 case '|': lprio
= OR_PRIO
; goto binop
;
722 case ANDAND
: lprio
= ANDAND_PRIO
; goto binop
;
723 case OROR
: lprio
= OROR_PRIO
; goto binop
;
725 lprio
= COMMA_PRIO
; goto binop
;
727 lprio
= PAREN_OUTER_PRIO
; rprio
= PAREN_INNER_PRIO
;
730 lprio
= PAREN_INNER_PRIO
; rprio
= PAREN_OUTER_PRIO
;
733 lprio
= COND_PRIO
; rprio
= COND_PRIO
;
736 lprio
= COND_PRIO
+ 1; rprio
= COND_PRIO
;
739 flags
= LEFT_OPERAND_REQUIRED
|RIGHT_OPERAND_REQUIRED
;
743 cpp_error (pfile
, "invalid character in #if");
748 /* Push a value onto the stack. */
749 if (top
->flags
& HAVE_VALUE
)
751 cpp_error (pfile
, "syntax error in #if");
754 top
->flags
|= HAVE_VALUE
;
758 /* Push an operator, and check if we can reduce now. */
759 while (top
->rprio
> lprio
)
761 long v1
= top
[-1].value
, v2
= top
[0].value
;
762 int unsigned1
= top
[-1].unsignedp
, unsigned2
= top
[0].unsignedp
;
764 if ((top
[1].flags
& LEFT_OPERAND_REQUIRED
)
765 && ! (top
[0].flags
& HAVE_VALUE
))
767 cpp_error (pfile
, "syntax error - missing left operand");
770 if ((top
[1].flags
& RIGHT_OPERAND_REQUIRED
)
771 && ! (top
[1].flags
& HAVE_VALUE
))
773 cpp_error (pfile
, "syntax error - missing right operand");
776 /* top[0].value = (top[1].op)(v1, v2);*/
780 if (!(top
->flags
& HAVE_VALUE
))
783 top
->unsignedp
= unsigned2
;
784 top
->flags
|= HAVE_VALUE
;
788 top
->value
= v1
+ v2
;
789 top
->unsignedp
= unsigned1
|| unsigned2
;
790 if (! top
->unsignedp
&& ! skip_evaluation
791 && ! possible_sum_sign (v1
, v2
, top
->value
))
792 integer_overflow (pfile
);
796 if (!(top
->flags
& HAVE_VALUE
))
799 if (!skip_evaluation
&& (top
->value
& v2
) < 0 && !unsigned2
)
800 integer_overflow (pfile
);
801 top
->unsignedp
= unsigned2
;
802 top
->flags
|= HAVE_VALUE
;
806 top
->value
= v1
- v2
;
807 top
->unsignedp
= unsigned1
|| unsigned2
;
808 if (! top
->unsignedp
&& ! skip_evaluation
809 && ! possible_sum_sign (top
->value
, v2
, v1
))
810 integer_overflow (pfile
);
814 top
->unsignedp
= unsigned1
|| unsigned2
;
816 top
->value
= (unsigned long) v1
* v2
;
817 else if (!skip_evaluation
)
819 top
->value
= v1
* v2
;
821 && (top
->value
/ v1
!= v2
822 || (top
->value
& v1
& v2
) < 0))
823 integer_overflow (pfile
);
831 cpp_error (pfile
, "division by zero in #if");
834 top
->unsignedp
= unsigned1
|| unsigned2
;
836 top
->value
= (unsigned long) v1
/ v2
;
839 top
->value
= v1
/ v2
;
840 if ((top
->value
& v1
& v2
) < 0)
841 integer_overflow (pfile
);
849 cpp_error (pfile
, "division by zero in #if");
852 top
->unsignedp
= unsigned1
|| unsigned2
;
854 top
->value
= (unsigned long) v1
% v2
;
856 top
->value
= v1
% v2
;
859 if (top
->flags
& HAVE_VALUE
)
861 cpp_error (pfile
, "syntax error");
866 top
->flags
|= HAVE_VALUE
;
869 if (top
->flags
& HAVE_VALUE
)
871 cpp_error (pfile
, "syntax error");
875 top
->unsignedp
= unsigned2
;
876 top
->flags
|= HAVE_VALUE
;
878 case '<': COMPARE(<); break;
879 case '>': COMPARE(>); break;
880 case LEQ
: COMPARE(<=); break;
881 case GEQ
: COMPARE(>=); break;
883 top
->value
= (v1
== v2
);
887 top
->value
= (v1
!= v2
);
893 top
->unsignedp
= unsigned1
;
894 if (v2
< 0 && ! unsigned2
)
895 top
->value
= right_shift (pfile
, v1
, unsigned1
, -v2
);
897 top
->value
= left_shift (pfile
, v1
, unsigned1
, v2
);
902 top
->unsignedp
= unsigned1
;
903 if (v2
< 0 && ! unsigned2
)
904 top
->value
= left_shift (pfile
, v1
, unsigned1
, -v2
);
906 top
->value
= right_shift (pfile
, v1
, unsigned1
, v2
);
908 #define LOGICAL(OP) \
909 top->value = v1 OP v2;\
910 top->unsignedp = unsigned1 || unsigned2;
911 case '&': LOGICAL(&); break;
912 case '^': LOGICAL(^); break;
913 case '|': LOGICAL(|); break;
915 top
->value
= v1
&& v2
; top
->unsignedp
= 0;
916 if (!v1
) skip_evaluation
--;
919 top
->value
= v1
|| v2
; top
->unsignedp
= 0;
920 if (v1
) skip_evaluation
--;
923 if (CPP_PEDANTIC (pfile
))
924 cpp_pedwarn (pfile
, "comma operator in operand of `#if'");
926 top
->unsignedp
= unsigned2
;
929 cpp_error (pfile
, "syntax error in #if");
932 if (top
[0].op
!= '?')
935 "syntax error ':' without preceding '?'");
938 else if (! (top
[1].flags
& HAVE_VALUE
)
939 || !(top
[-1].flags
& HAVE_VALUE
)
940 || !(top
[0].flags
& HAVE_VALUE
))
942 cpp_error (pfile
, "bad syntax for ?: operator");
948 if (top
->value
) skip_evaluation
--;
949 top
->value
= top
->value
? v1
: v2
;
950 top
->unsignedp
= unsigned1
|| unsigned2
;
954 if ((top
[1].flags
& HAVE_VALUE
)
955 || ! (top
[0].flags
& HAVE_VALUE
)
957 || (top
[-1].flags
& HAVE_VALUE
))
959 cpp_error (pfile
, "mismatched parentheses in #if");
966 top
->unsignedp
= unsigned1
;
967 top
->flags
|= HAVE_VALUE
;
972 top
[1].op
>= ' ' && top
[1].op
<= '~'
973 ? "unimplemented operator '%c'\n"
974 : "unimplemented operator '\\%03o'\n",
981 cpp_error (pfile
, "internal error in #if expression");
982 if (stack
!= init_stack
)
988 /* Check for and handle stack overflow. */
991 struct operation
*new_stack
;
992 int old_size
= (char *) limit
- (char *) stack
;
993 int new_size
= 2 * old_size
;
994 if (stack
!= init_stack
)
995 new_stack
= (struct operation
*) xrealloc (stack
, new_size
);
998 new_stack
= (struct operation
*) xmalloc (new_size
);
999 bcopy ((char *) stack
, (char *) new_stack
, old_size
);
1002 top
= (struct operation
*) ((char *) new_stack
+ old_size
);
1003 limit
= (struct operation
*) ((char *) new_stack
+ new_size
);
1009 if ((op
.op
== OROR
&& top
[-1].value
)
1010 || (op
.op
== ANDAND
&& !top
[-1].value
)
1011 || (op
.op
== '?' && !top
[-1].value
))
1015 else if (op
.op
== ':')
1017 if (top
[-2].value
) /* Was condition true? */
1024 if (stack
!= init_stack
)
1026 skip_rest_of_line (pfile
);