1 /* Parse C expressions for CCCP.
2 Copyright (C) 1987, 92, 94, 95, 97, 98, 1999, 2000 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 */
31 #ifdef MULTIBYTE_CHARS
35 #ifndef CHAR_TYPE_SIZE
36 #define CHAR_TYPE_SIZE BITS_PER_UNIT
40 #define INT_TYPE_SIZE BITS_PER_WORD
43 #ifndef LONG_TYPE_SIZE
44 #define LONG_TYPE_SIZE BITS_PER_WORD
47 #ifndef WCHAR_TYPE_SIZE
48 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
51 #ifndef MAX_CHAR_TYPE_SIZE
52 #define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE
55 #ifndef MAX_INT_TYPE_SIZE
56 #define MAX_INT_TYPE_SIZE INT_TYPE_SIZE
59 #ifndef MAX_LONG_TYPE_SIZE
60 #define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE
63 #ifndef MAX_WCHAR_TYPE_SIZE
64 #define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
67 #define MAX_CHAR_TYPE_MASK (MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDEST_INT \
68 ? (~ (~ (HOST_WIDEST_INT) 0 << MAX_CHAR_TYPE_SIZE)) \
69 : ~ (HOST_WIDEST_INT) 0)
71 #define MAX_WCHAR_TYPE_MASK (MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDEST_INT \
72 ? ~ (~ (HOST_WIDEST_INT) 0 << MAX_WCHAR_TYPE_SIZE) \
73 : ~ (HOST_WIDEST_INT) 0)
75 /* Yield nonzero if adding two numbers with A's and B's signs can yield a
76 number with SUM's sign, where A, B, and SUM are all C integers. */
77 #define possible_sum_sign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0)
79 static void integer_overflow PARAMS ((cpp_reader *));
80 static HOST_WIDEST_INT left_shift PARAMS ((cpp_reader *, HOST_WIDEST_INT, int, unsigned HOST_WIDEST_INT));
81 static HOST_WIDEST_INT right_shift PARAMS ((cpp_reader *, HOST_WIDEST_INT, int, unsigned HOST_WIDEST_INT));
82 static struct operation parse_number PARAMS ((cpp_reader *, U_CHAR *, U_CHAR *));
83 static struct operation parse_charconst PARAMS ((cpp_reader *, U_CHAR *, U_CHAR *));
84 static struct operation cpp_lex PARAMS ((cpp_reader *, int));
85 extern HOST_WIDEST_INT cpp_parse_expr PARAMS ((cpp_reader *));
86 static HOST_WIDEST_INT cpp_parse_escape PARAMS ((cpp_reader *, U_CHAR **, HOST_WIDEST_INT));
101 #define LEFT_OPERAND_REQUIRED 1
102 #define RIGHT_OPERAND_REQUIRED 2
104 /* SKIP_OPERAND is set for '&&' '||' '?' and ':' when the
105 following operand should be short-circuited instead of evaluated. */
106 #define SKIP_OPERAND 8
107 /*#define UNSIGNEDP 16*/
111 char rprio; /* Priority of op (relative to it right operand). */
113 char unsignedp; /* true if value should be treated as unsigned */
114 HOST_WIDEST_INT value; /* The value logically "right" of op. */
117 /* Parse and convert an integer for #if. Accepts decimal, hex, or octal
118 with or without size suffixes. */
120 static struct operation
121 parse_number (pfile, start, end)
129 unsigned HOST_WIDEST_INT n = 0, nd, MAX_over_base;
132 int digit, largest_digit = 0;
139 if (end - start >= 3 && (p[1] == 'x' || p[1] == 'X'))
151 /* Some buggy compilers (e.g. MPW C) seem to need both casts. */
152 MAX_over_base = (((unsigned HOST_WIDEST_INT) -1)
153 / ((unsigned HOST_WIDEST_INT) base));
159 if (c >= '0' && c <= '9')
161 else if (base == 16 && c >= 'a' && c <= 'f') /* FIXME: assumes ASCII */
162 digit = c - 'a' + 10;
163 else if (base == 16 && c >= 'A' && c <= 'F')
164 digit = c - 'A' + 10;
167 /* It's a float since it contains a point. */
169 "floating point numbers are not allowed in #if expressions");
174 /* `l' means long, and `u' means unsigned. */
177 if (c == 'l' || c == 'L')
179 else if (c == 'u' || c == 'U')
183 /* Decrement p here so that the error for an invalid number
184 will be generated below in the case where this is the
185 last character in the buffer. */
193 /* Don't look for any more digits after the suffixes. */
197 if (largest_digit < digit)
198 largest_digit = digit;
199 nd = n * base + digit;
200 overflow |= MAX_over_base < n || nd < n;
206 cpp_error (pfile, "invalid number in #if expression");
209 else if (spec_long > (CPP_OPTIONS (pfile)->c89 ? 1 : 2))
211 cpp_error (pfile, "too many `l' suffixes in integer constant");
214 else if (op.unsignedp > 1)
216 cpp_error (pfile, "too many `u' suffixes in integer constant");
220 if (base <= largest_digit)
221 cpp_pedwarn (pfile, "integer constant contains digits beyond the radix");
224 cpp_pedwarn (pfile, "integer constant out of range");
226 /* If too big to be signed, consider it unsigned. */
227 else if ((HOST_WIDEST_INT) n < 0 && ! op.unsignedp)
231 "integer constant is so large that it is unsigned");
244 /* Parse and convert a character constant for #if. Understands backslash
245 escapes (\n, \031) and multibyte characters (if so configured). */
246 static struct operation
247 parse_charconst (pfile, start, end)
253 HOST_WIDEST_INT result = 0;
256 unsigned int width = MAX_CHAR_TYPE_SIZE, mask = MAX_CHAR_TYPE_MASK;
260 /* FIXME: Should use reentrant multibyte functions. */
261 #ifdef MULTIBYTE_CHARS
262 wchar_t c = (wchar_t)-1;
263 (void) mbtowc (NULL_PTR, NULL_PTR, 0);
271 width = MAX_WCHAR_TYPE_SIZE, mask = MAX_WCHAR_TYPE_MASK;
273 max_chars = MAX_LONG_TYPE_SIZE / width;
275 ++ptr; /* skip initial quote */
279 #ifndef MULTIBYTE_CHARS
282 ptr += mbtowc (&c, ptr, end - ptr);
284 if (c == '\'' || c == '\0')
288 /* Hopefully valid assumption: if mbtowc returns a backslash,
289 we are in initial shift state. No valid escape-sequence
290 character can take us out of initial shift state or begin
291 an unshifted multibyte char, so cpp_parse_escape doesn't
292 need to know about multibyte chars. */
294 c = cpp_parse_escape (pfile, &ptr, mask);
295 if (width < HOST_BITS_PER_INT
296 && (unsigned int) c >= (unsigned int)(1 << width))
297 cpp_pedwarn (pfile, "escape sequence out of range for character");
300 /* Merge character into result; ignore excess chars. */
301 if (++num_chars <= max_chars)
303 if (width < HOST_BITS_PER_INT)
304 result = (result << width) | (c & ((1 << width) - 1));
312 cpp_error (pfile, "empty character constant");
317 /* cpp_get_token has already emitted an error if !traditional. */
318 if (! CPP_TRADITIONAL (pfile))
319 cpp_error (pfile, "malformatted character constant");
322 else if (num_chars > max_chars)
324 cpp_error (pfile, "character constant too long");
327 else if (num_chars != 1 && ! CPP_TRADITIONAL (pfile))
328 cpp_warning (pfile, "multi-character character constant");
330 /* If char type is signed, sign-extend the constant. */
331 num_bits = num_chars * width;
333 if (cpp_defined (pfile, (const U_CHAR *)"__CHAR_UNSIGNED__",
334 sizeof ("__CHAR_UNSIGNED__")-1)
335 || ((result >> (num_bits - 1)) & 1) == 0)
336 op.value = result & ((unsigned HOST_WIDEST_INT) ~0
337 >> (HOST_BITS_PER_WIDEST_INT - num_bits));
339 op.value = result | ~((unsigned HOST_WIDEST_INT) ~0
340 >> (HOST_BITS_PER_WIDEST_INT - num_bits));
342 /* This is always a signed type. */
354 const char *operator;
358 static struct token tokentab2[] = {
372 /* Read one token. */
374 static struct operation
375 cpp_lex (pfile, skip_evaluation)
379 struct token *toktab;
380 enum cpp_token token;
382 U_CHAR *tok_start, *tok_end;
385 old_written = CPP_WRITTEN (pfile);
386 token = get_directive_token (pfile);
388 tok_start = pfile->token_buffer + old_written;
389 tok_end = CPP_PWRITTEN (pfile);
390 CPP_SET_WRITTEN (pfile, old_written);
393 case CPP_EOF: /* Should not happen ... */
398 return parse_number (pfile, tok_start, tok_end);
401 cpp_error (pfile, "string constants are not allowed in #if expressions");
407 return parse_charconst (pfile, tok_start, tok_end);
413 if (strcmp (tok_start, "defined"))
415 if (CPP_WARN_UNDEF (pfile) && !skip_evaluation)
416 cpp_warning (pfile, "`%.*s' is not defined",
417 (int) (tok_end - tok_start), tok_start);
424 pfile->no_macro_expand++;
425 token = get_directive_token (pfile);
426 if (token == CPP_LPAREN)
429 CPP_SET_WRITTEN (pfile, old_written);
430 token = get_directive_token (pfile);
433 if (token != CPP_NAME)
436 tok = pfile->token_buffer + old_written;
437 len = CPP_PWRITTEN (pfile) - tok;
438 if (cpp_defined (pfile, tok, len))
443 if (get_directive_token (pfile) != CPP_RPAREN)
446 CPP_SET_WRITTEN (pfile, old_written);
447 pfile->no_macro_expand--;
452 CPP_SET_WRITTEN (pfile, old_written);
453 pfile->no_macro_expand--;
454 cpp_error (pfile, "`defined' without an identifier");
458 /* See if it is a special token of length 2. */
459 if (tok_start + 2 == tok_end)
461 for (toktab = tokentab2; toktab->operator != NULL; toktab++)
462 if (tok_start[0] == toktab->operator[0]
463 && tok_start[1] == toktab->operator[1])
465 if (toktab->token == ERROR)
466 cpp_error (pfile, "`%s' not allowed in operand of `#if'",
468 op.op = toktab->token;
471 else if (tok_start + 1 == tok_end && *tok_start == '#')
473 CPP_FORWARD (CPP_BUFFER (pfile), -1);
475 op.value = cpp_read_check_assertion (pfile);
486 /* Parse a C escape sequence. STRING_PTR points to a variable
487 containing a pointer to the string to parse. That pointer
488 is updated past the characters we use. The value of the
489 escape sequence is returned.
491 A negative value means the sequence \ newline was seen,
492 which is supposed to be equivalent to nothing at all.
494 If \ is followed by a null character, we return a negative
495 value and leave the string pointer pointing at the null character.
497 If \ is followed by 000, we return 0 and leave the string pointer
498 after the zeros. A value of 0 does not mean end of string. */
500 static HOST_WIDEST_INT
501 cpp_parse_escape (pfile, string_ptr, result_mask)
504 HOST_WIDEST_INT result_mask;
506 register int c = *(*string_ptr)++;
515 if (CPP_OPTIONS (pfile)->pedantic)
516 cpp_pedwarn (pfile, "non-ANSI-standard escape sequence, `\\%c'", c);
521 return TARGET_NEWLINE;
543 register HOST_WIDEST_INT i = c - '0';
544 register int count = 0;
547 c = *(*string_ptr)++;
548 if (c >= '0' && c <= '7')
549 i = (i << 3) + c - '0';
556 if (i != (i & result_mask))
559 cpp_pedwarn (pfile, "octal escape sequence out of range");
565 register unsigned HOST_WIDEST_INT i = 0, overflow = 0;
566 register int digits_found = 0, digit;
569 c = *(*string_ptr)++;
570 if (c >= '0' && c <= '9')
572 else if (c >= 'a' && c <= 'f')
573 digit = c - 'a' + 10;
574 else if (c >= 'A' && c <= 'F')
575 digit = c - 'A' + 10;
581 overflow |= i ^ (i << 4 >> 4);
582 i = (i << 4) + digit;
586 cpp_error (pfile, "\\x used with no following hex digits");
587 if (overflow | (i != (i & result_mask)))
590 cpp_pedwarn (pfile, "hex escape sequence out of range");
600 integer_overflow (pfile)
603 if (CPP_PEDANTIC (pfile))
604 cpp_pedwarn (pfile, "integer overflow in preprocessor expression");
607 static HOST_WIDEST_INT
608 left_shift (pfile, a, unsignedp, b)
612 unsigned HOST_WIDEST_INT b;
614 if (b >= HOST_BITS_PER_WIDEST_INT)
616 if (! unsignedp && a != 0)
617 integer_overflow (pfile);
621 return (unsigned HOST_WIDEST_INT) a << b;
624 HOST_WIDEST_INT l = a << b;
626 integer_overflow (pfile);
631 static HOST_WIDEST_INT
632 right_shift (pfile, a, unsignedp, b)
633 cpp_reader *pfile ATTRIBUTE_UNUSED;
636 unsigned HOST_WIDEST_INT b;
638 if (b >= HOST_BITS_PER_WIDEST_INT)
639 return unsignedp ? 0 : a >> (HOST_BITS_PER_WIDEST_INT - 1);
641 return (unsigned HOST_WIDEST_INT) a >> b;
646 /* These priorities are all even, so we can handle associatively. */
647 #define PAREN_INNER_PRIO 0
649 #define COND_PRIO (COMMA_PRIO+2)
650 #define OROR_PRIO (COND_PRIO+2)
651 #define ANDAND_PRIO (OROR_PRIO+2)
652 #define OR_PRIO (ANDAND_PRIO+2)
653 #define XOR_PRIO (OR_PRIO+2)
654 #define AND_PRIO (XOR_PRIO+2)
655 #define EQUAL_PRIO (AND_PRIO+2)
656 #define LESS_PRIO (EQUAL_PRIO+2)
657 #define SHIFT_PRIO (LESS_PRIO+2)
658 #define PLUS_PRIO (SHIFT_PRIO+2)
659 #define MUL_PRIO (PLUS_PRIO+2)
660 #define UNARY_PRIO (MUL_PRIO+2)
661 #define PAREN_OUTER_PRIO (UNARY_PRIO+2)
663 #define COMPARE(OP) \
665 top->value = (unsigned1 || unsigned2) \
666 ? (unsigned HOST_WIDEST_INT) v1 OP (unsigned HOST_WIDEST_INT) v2 : (v1 OP v2)
668 /* Parse and evaluate a C expression, reading from PFILE.
669 Returns the value of the expression. */
672 cpp_parse_expr (pfile)
675 /* The implementation is an operator precedence parser,
676 i.e. a bottom-up parser, using a stack for not-yet-reduced tokens.
678 The stack base is 'stack', and the current stack pointer is 'top'.
679 There is a stack element for each operator (only),
680 and the most recently pushed operator is 'top->op'.
681 An operand (value) is stored in the 'value' field of the stack
682 element of the operator that precedes it.
683 In that case the 'flags' field has the HAVE_VALUE flag set. */
685 #define INIT_STACK_SIZE 20
686 struct operation init_stack[INIT_STACK_SIZE];
687 struct operation *stack = init_stack;
688 struct operation *limit = stack + INIT_STACK_SIZE;
689 register struct operation *top = stack;
690 int lprio, rprio = 0;
691 int skip_evaluation = 0;
701 op = cpp_lex (pfile, skip_evaluation);
703 /* See if the token is an operand, in which case go to set_value.
704 If the token is an operator, figure out its left and right
705 priorities, and then goto maybe_reduce. */
710 cpp_ice (pfile, "cpp_lex returns a NAME");
715 lprio = 0; goto maybe_reduce;
717 if (top->flags & HAVE_VALUE)
722 /* else fall through */
724 flags = RIGHT_OPERAND_REQUIRED;
725 rprio = UNARY_PRIO; lprio = rprio + 1; goto maybe_reduce;
726 case '*': case '/': case '%':
727 lprio = MUL_PRIO; goto binop;
728 case '<': case '>': case LEQ: case GEQ:
729 lprio = LESS_PRIO; goto binop;
730 case EQUAL: case NOTEQUAL:
731 lprio = EQUAL_PRIO; goto binop;
733 lprio = SHIFT_PRIO; goto binop;
734 case '&': lprio = AND_PRIO; goto binop;
735 case '^': lprio = XOR_PRIO; goto binop;
736 case '|': lprio = OR_PRIO; goto binop;
737 case ANDAND: lprio = ANDAND_PRIO; goto binop;
738 case OROR: lprio = OROR_PRIO; goto binop;
740 lprio = COMMA_PRIO; goto binop;
742 lprio = PAREN_OUTER_PRIO; rprio = PAREN_INNER_PRIO;
745 lprio = PAREN_INNER_PRIO; rprio = PAREN_OUTER_PRIO;
748 lprio = COND_PRIO; rprio = COND_PRIO;
751 lprio = COND_PRIO + 1; rprio = COND_PRIO;
756 cpp_error (pfile, "invalid character in #if");
761 /* Push a value onto the stack. */
762 if (top->flags & HAVE_VALUE)
764 cpp_error (pfile, "syntax error in #if");
767 top->value = op.value;
768 top->unsignedp = op.unsignedp;
769 top->flags |= HAVE_VALUE;
773 flags = LEFT_OPERAND_REQUIRED|RIGHT_OPERAND_REQUIRED;
777 /* Push an operator, and check if we can reduce now. */
778 while (top->rprio > lprio)
780 HOST_WIDEST_INT v1 = top[-1].value, v2 = top[0].value;
781 int unsigned1 = top[-1].unsignedp, unsigned2 = top[0].unsignedp;
783 if ((top[1].flags & LEFT_OPERAND_REQUIRED)
784 && ! (top[0].flags & HAVE_VALUE))
786 cpp_error (pfile, "syntax error - missing left operand");
789 if ((top[1].flags & RIGHT_OPERAND_REQUIRED)
790 && ! (top[1].flags & HAVE_VALUE))
792 cpp_error (pfile, "syntax error - missing right operand");
795 /* top[0].value = (top[1].op)(v1, v2);*/
799 if (!(top->flags & HAVE_VALUE))
802 top->unsignedp = unsigned2;
803 top->flags |= HAVE_VALUE;
807 top->value = v1 + v2;
808 top->unsignedp = unsigned1 || unsigned2;
809 if (! top->unsignedp && ! skip_evaluation
810 && ! possible_sum_sign (v1, v2, top->value))
811 integer_overflow (pfile);
815 if (!(top->flags & HAVE_VALUE))
818 if (!skip_evaluation && (top->value & v2) < 0 && !unsigned2)
819 integer_overflow (pfile);
820 top->unsignedp = unsigned2;
821 top->flags |= HAVE_VALUE;
825 top->value = v1 - v2;
826 top->unsignedp = unsigned1 || unsigned2;
827 if (! top->unsignedp && ! skip_evaluation
828 && ! possible_sum_sign (top->value, v2, v1))
829 integer_overflow (pfile);
833 top->unsignedp = unsigned1 || unsigned2;
835 top->value = (unsigned HOST_WIDEST_INT) v1 * v2;
836 else if (!skip_evaluation)
838 top->value = v1 * v2;
840 && (top->value / v1 != v2
841 || (top->value & v1 & v2) < 0))
842 integer_overflow (pfile);
850 cpp_error (pfile, "division by zero in #if");
853 top->unsignedp = unsigned1 || unsigned2;
855 top->value = (unsigned HOST_WIDEST_INT) v1 / v2;
858 top->value = v1 / v2;
859 if ((top->value & v1 & v2) < 0)
860 integer_overflow (pfile);
868 cpp_error (pfile, "division by zero in #if");
871 top->unsignedp = unsigned1 || unsigned2;
873 top->value = (unsigned HOST_WIDEST_INT) v1 % v2;
875 top->value = v1 % v2;
878 if (top->flags & HAVE_VALUE)
880 cpp_error (pfile, "syntax error");
885 top->flags |= HAVE_VALUE;
888 if (top->flags & HAVE_VALUE)
890 cpp_error (pfile, "syntax error");
894 top->unsignedp = unsigned2;
895 top->flags |= HAVE_VALUE;
897 case '<': COMPARE(<); break;
898 case '>': COMPARE(>); break;
899 case LEQ: COMPARE(<=); break;
900 case GEQ: COMPARE(>=); break;
902 top->value = (v1 == v2);
906 top->value = (v1 != v2);
912 top->unsignedp = unsigned1;
913 if (v2 < 0 && ! unsigned2)
914 top->value = right_shift (pfile, v1, unsigned1, -v2);
916 top->value = left_shift (pfile, v1, unsigned1, v2);
921 top->unsignedp = unsigned1;
922 if (v2 < 0 && ! unsigned2)
923 top->value = left_shift (pfile, v1, unsigned1, -v2);
925 top->value = right_shift (pfile, v1, unsigned1, v2);
927 #define LOGICAL(OP) \
928 top->value = v1 OP v2;\
929 top->unsignedp = unsigned1 || unsigned2;
930 case '&': LOGICAL(&); break;
931 case '^': LOGICAL(^); break;
932 case '|': LOGICAL(|); break;
934 top->value = v1 && v2; top->unsignedp = 0;
935 if (!v1) skip_evaluation--;
938 top->value = v1 || v2; top->unsignedp = 0;
939 if (v1) skip_evaluation--;
942 if (CPP_PEDANTIC (pfile))
943 cpp_pedwarn (pfile, "comma operator in operand of `#if'");
945 top->unsignedp = unsigned2;
948 cpp_error (pfile, "syntax error in #if");
951 if (top[0].op != '?')
954 "syntax error ':' without preceding '?'");
957 else if (! (top[1].flags & HAVE_VALUE)
958 || !(top[-1].flags & HAVE_VALUE)
959 || !(top[0].flags & HAVE_VALUE))
961 cpp_error (pfile, "bad syntax for ?: operator");
967 if (top->value) skip_evaluation--;
968 top->value = top->value ? v1 : v2;
969 top->unsignedp = unsigned1 || unsigned2;
973 if ((top[1].flags & HAVE_VALUE)
974 || ! (top[0].flags & HAVE_VALUE)
976 || (top[-1].flags & HAVE_VALUE))
978 cpp_error (pfile, "mismatched parentheses in #if");
985 top->unsignedp = unsigned1;
986 top->flags |= HAVE_VALUE;
990 if (ISGRAPH (top[1].op))
991 cpp_error (pfile, "unimplemented operator '%c'\n", top[1].op);
993 cpp_error (pfile, "unimplemented operator '\\%03o'\n",
1000 cpp_ice (pfile, "unbalanced stack in #if expression");
1001 if (stack != init_stack)
1007 /* Check for and handle stack overflow. */
1010 struct operation *new_stack;
1011 int old_size = (char *) limit - (char *) stack;
1012 int new_size = 2 * old_size;
1013 if (stack != init_stack)
1014 new_stack = (struct operation *) xrealloc (stack, new_size);
1017 new_stack = (struct operation *) xmalloc (new_size);
1018 bcopy ((char *) stack, (char *) new_stack, old_size);
1021 top = (struct operation *) ((char *) new_stack + old_size);
1022 limit = (struct operation *) ((char *) new_stack + new_size);
1028 if ((op.op == OROR && top[-1].value)
1029 || (op.op == ANDAND && !top[-1].value)
1030 || (op.op == '?' && !top[-1].value))
1034 else if (op.op == ':')
1036 if (top[-2].value) /* Was condition true? */
1043 if (stack != init_stack)