diff Parser/node.c @ 14147:21ec69a56228 legacy-trunk

Charles G. Waldman <cgw@fnal.gov>: Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit arguments to opcodes instead of being forced to stick to the 16-bit limit. This is especially useful for machine-generated code, which can be too long for the SET_LINENO parameter to fit into 16 bits. This closes the implementation portion of SourceForge patch #100893.
author Fred Drake <fdrake@acm.org>
date Thu, 24 Aug 2000 00:32:09 +0000
parents e78153e179fb
children 6f6f965c5e2d
line wrap: on
line diff
--- a/Parser/node.c	Wed Aug 23 23:31:34 2000 +0000
+++ b/Parser/node.c	Thu Aug 24 00:32:09 2000 +0000
@@ -8,7 +8,12 @@
 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 ******************************************************************/
 
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
+#ifndef INT_MAX
+#define INT_MAX 2147483647
+#endif
 
 /* Parse tree node implementation */
 
@@ -39,7 +44,7 @@
 	register int nch = n1->n_nchildren;
 	register int nch1 = nch+1;
 	register node *n;
-	if (nch == SHRT_MAX || nch < 0)
+	if (nch == INT_MAX || nch < 0)
 		return E_OVERFLOW;
 	if (XXXROUNDUP(nch) < nch1) {
 		n = n1->n_child;