diff options
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 5957951..4a6c009 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -8235,6 +8235,7 @@ TEBCresume( bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL, NULL); opnd = TclGetUInt4AtPtr(pc+1); pc += (opnd-1); + assert(bytes); PUSH_OBJECT(Tcl_NewStringObj(bytes, length)); goto instEvalStk; } @@ -9900,7 +9901,12 @@ TclGetSourceFromFrame( cfPtr->cmd = GetSrcInfoForPc((unsigned char *) cfPtr->data.tebc.pc, codePtr, &cfPtr->len, NULL, NULL); } - cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len); + if (cfPtr->cmd) { + cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len); + } else { + cfPtr->cmdObj = Tcl_NewListObj(objc, objv); + cfPtr->cmd = Tcl_GetStringFromObj(cfPtr->cmdObj, &cfPtr->len); + } Tcl_IncrRefCount(cfPtr->cmdObj); } return cfPtr->cmdObj; @@ -10081,6 +10087,10 @@ GetSrcInfoForPc( *pcBeg = prev; } + if (bestDist == INT_MAX) { + return NULL; + } + if (lengthPtr != NULL) { *lengthPtr = bestSrcLength; } @@ -10089,10 +10099,6 @@ GetSrcInfoForPc( *cmdIdxPtr = bestCmdIdx; } - if (bestDist == INT_MAX) { - return NULL; - } - return (codePtr->source + bestSrcOffset); } |