Bugs item #1409443, was opened at 2006-01-18 16:57
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1409443&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: John Ehresman (jpe)
Assigned to: Raymond Hettinger (rhettinger)
Summary: frame->f_lasti not always correct

Initial Comment:
Contrary to the comment in ceval.c, the f_lasti field
is not always correct because it is not updated by the
PREDICT / PREDICTED macros.  This means that when a
GET_ITER is followed by a FOR_ITER, f_lasti will be
left at the index of the GET_ITER the first time
FOR_ITER is executed.  I don't think this is a problem
for YIELD_VALUE because it's not predicted to follow
any other opcode.

I'm running into this when examining bytecode in
calling frames within a debugger callback.

I suggest either documenting that f_lasti may be
incorrect or adjusting it in the PREDICTED macro.

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2007-01-05 20:17

Message:
Logged In: YES 
user_id=80475
Originator: NO

Expanded comment in rev 53285.

IMO, the f->f_lasti is not incorrect.  In effect, a successful prediction
links the opcodes so that two codes function as a single new code
(GET_ITER, FOR_ITER) -->  GET_ITER_FOR_ITER.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-01-19 00:32

Message:
Logged In: YES 
user_id=33168

Raymond?  Given that PREDICTED was added for performance, I
would lean toward updating the doc.  I didn't look at the
code, but I'm pretty sure John's description is accurate.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1409443&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to