diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-04-13 22:09:59 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-04-13 22:09:59 (GMT) |
commit | 9d9fbb435935503b9fbd2754c2d8745d6239229a (patch) | |
tree | 9fb14842c81ab549c96410817c94d48ddd378b95 | |
parent | 9bd522d7d13b8db51a87e650c5b439ccf49c616c (diff) | |
download | cpython-9d9fbb435935503b9fbd2754c2d8745d6239229a.zip cpython-9d9fbb435935503b9fbd2754c2d8745d6239229a.tar.gz cpython-9d9fbb435935503b9fbd2754c2d8745d6239229a.tar.bz2 |
Fix a bug when using the __lltrace__ opcode tracer, and a problem sith signed chars in frameobject.c which can occur with opcodes > 127
-rw-r--r-- | Objects/frameobject.c | 4 | ||||
-rw-r--r-- | Python/ceval.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 3a073b6..c12b70c 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -68,7 +68,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno) int new_lineno = 0; /* The new value of f_lineno */ int new_lasti = 0; /* The new value of f_lasti */ int new_iblock = 0; /* The new value of f_iblock */ - char *code = NULL; /* The bytecode for the frame... */ + unsigned char *code = NULL; /* The bytecode for the frame... */ Py_ssize_t code_len = 0; /* ...and its length */ char *lnotab = NULL; /* Iterating over co_lnotab */ Py_ssize_t lnotab_len = 0; /* (ditto) */ @@ -85,7 +85,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno) int blockstack[CO_MAXBLOCKS]; /* Walking the 'finally' blocks */ int in_finally[CO_MAXBLOCKS]; /* (ditto) */ int blockstack_top = 0; /* (ditto) */ - int setup_op = 0; /* (ditto) */ + unsigned char setup_op = 0; /* (ditto) */ /* f_lineno must be an integer. */ if (!PyInt_Check(p_new_lineno)) { diff --git a/Python/ceval.c b/Python/ceval.c index 9dddd2f..b1ba426 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -662,7 +662,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) #define STACKADJ(n) { (void)(BASIC_STACKADJ(n), \ lltrace && prtrace(TOP(), "stackadj")); \ assert(STACK_LEVEL() <= co->co_stacksize); } -#define EXT_POP(STACK_POINTER) (lltrace && prtrace(*(STACK_POINTER), "ext_pop"), *--(STACK_POINTER)) +#define EXT_POP(STACK_POINTER) (lltrace && prtrace((STACK_POINTER)[-1], "ext_pop"), *--(STACK_POINTER)) #else #define PUSH(v) BASIC_PUSH(v) #define POP() BASIC_POP() |