summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-08-24 00:32:09 (GMT)
committerFred Drake <fdrake@acm.org>2000-08-24 00:32:09 (GMT)
commitef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d (patch)
tree799778ef59de6c384636792eb8f1e2ddc1e918a8 /Parser
parente266e42c9c1d20b24d18def1c4398e75fe1620f0 (diff)
downloadcpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.zip
cpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.tar.gz
cpython-ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d.tar.bz2
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.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/node.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Parser/node.c b/Parser/node.c
index 910192d..6844965 100644
--- a/Parser/node.c
+++ b/Parser/node.c
@@ -8,7 +8,12 @@ See the file "Misc/COPYRIGHT" for information on usage and
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 @@ PyNode_AddChild(register node *n1, int type, char *str, int lineno)
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;