mirror of
https://github.com/python/cpython.git
synced 2025-12-10 02:50:09 +00:00
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.
This commit is contained in:
parent
e266e42c9c
commit
ef8ace3a6f
6 changed files with 56 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue