summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormig <mig>2012-10-28 18:58:20 (GMT)
committermig <mig>2012-10-28 18:58:20 (GMT)
commit3cc94c1d69092f90d3aca7121cc57b3b6d4bbd2c (patch)
treecdebe2766e1d01cc901fca814411f1d7b63d3416 /generic
parent4f20c3d555d869755b8fbe5cf295f4898929c8a3 (diff)
downloadtcl-3cc94c1d69092f90d3aca7121cc57b3b6d4bbd2c.zip
tcl-3cc94c1d69092f90d3aca7121cc57b3b6d4bbd2c.tar.gz
tcl-3cc94c1d69092f90d3aca7121cc57b3b6d4bbd2c.tar.bz2
fix INST_YIELD so that it worksdkf_bytecode_8_6_yield
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 30f8d77..b42e4ab 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2345,17 +2345,33 @@ TEBCresume(
goto gotError;
}
- Tcl_SetObjResult(interp, OBJ_AT_TOS);
- TclNRAddCallback(interp, TclNRCoroutineActivateCallback, corPtr,
- INT2PTR(0), NULL, NULL);
-
#ifdef TCL_COMPILE_DEBUG
TRACE_WITH_OBJ(("yield, result="), iPtr->objResultPtr);
if (traceInstructions) {
fprintf(stdout, "\n");
}
#endif
- goto checkForCatch;
+ /* TIP #280: Record the last piece of info needed by
+ * 'TclGetSrcInfoForPc', and push the frame.
+ */
+
+ bcFramePtr->data.tebc.pc = (char *) pc;
+ iPtr->cmdFramePtr = bcFramePtr;
+
+ if (iPtr->flags & INTERP_DEBUG_FRAME) {
+ TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
+ codePtr, bcFramePtr, pc - codePtr->codeStart);
+ }
+
+ pc++;
+ cleanup = 1;
+ TEBC_YIELD();
+
+ Tcl_SetObjResult(interp, OBJ_AT_TOS);
+ TclNRAddCallback(interp, TclNRCoroutineActivateCallback, corPtr,
+ INT2PTR(0), NULL, NULL);
+
+ return TCL_OK;
}
case INST_DONE: