[Python-Dev] Needless assert in ceval.c? (original) (raw)
skip at pobox.com skip at pobox.com
Fri Jan 9 05:53:53 CET 2009
- Previous message: [Python-Dev] OSCON 2009: Call For Participation
- Next message: [Python-Dev] http://bugs.python.org/issue3628
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I realize assert() is compiled out except in debug builds, but the assert in the while loop following the fast_block_end label in ceval.c seems misleading. It looks like it should be hoisted out of the loop and only checked before entering the loop. There are no jumps into the loop. why is not assigned WHY_YIELD within the loop. If you assert before the loop once I think that will be sufficient and more clearly state the intent.
fast_block_end: assert(why != WHY_YIELD); /* move the assert here */ while (why != WHY_NOT && f->f_iblock > 0) { PyTryBlock *b = PyFrame_BlockPop(f);
/* get rid of the assert here */
if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) {
...
}
...
} /* unwind stack */
Reported to the tracker: http://bugs.python.org/issue4888
Skip
- Previous message: [Python-Dev] OSCON 2009: Call For Participation
- Next message: [Python-Dev] http://bugs.python.org/issue3628
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]