[Python-checkins] CVS: python/dist/src/Parser node.c,2.12,2.13
Fred L. Drake
python-dev@python.org
Wed, 23 Aug 2000 17:32:12 -0700
Update of /cvsroot/python/python/dist/src/Parser
In directory slayer.i.sourceforge.net:/tmp/cvs-serv19656/Parser
Modified Files:
node.c
Log Message:
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.
Index: node.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/node.c,v
retrieving revision 2.12
retrieving revision 2.13
diff -C2 -r2.12 -r2.13
*** node.c 2000/07/22 19:20:54 2.12
--- node.c 2000/08/24 00:32:09 2.13
***************
*** 9,13 ****
--- 9,18 ----
******************************************************************/
+ #ifdef HAVE_LIMITS_H
#include <limits.h>
+ #endif
+ #ifndef INT_MAX
+ #define INT_MAX 2147483647
+ #endif
/* Parse tree node implementation */
***************
*** 40,44 ****
register int nch1 = nch+1;
register node *n;
! if (nch == SHRT_MAX || nch < 0)
return E_OVERFLOW;
if (XXXROUNDUP(nch) < nch1) {
--- 45,49 ----
register int nch1 = nch+1;
register node *n;
! if (nch == INT_MAX || nch < 0)
return E_OVERFLOW;
if (XXXROUNDUP(nch) < nch1) {