summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-08-06 16:20:59 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-08-06 16:20:59 (GMT)
commitf56c89a9c1633b26c4f2ef5a898a92e0331ce678 (patch)
tree74240aab87dc52a7409c56226eb7aaa1010e0650 /generic
parentc13bb10d72906770febda3135e8407326a24663c (diff)
downloadtcl-f56c89a9c1633b26c4f2ef5a898a92e0331ce678.zip
tcl-f56c89a9c1633b26c4f2ef5a898a92e0331ce678.tar.gz
tcl-f56c89a9c1633b26c4f2ef5a898a92e0331ce678.tar.bz2
Add assertions that will guide and protect more discovery of dead code for elimination.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclExecute.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index baa2f2c..1889dfd 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -6109,6 +6109,8 @@ TclNREvalObjEx(
ContLineLoc *saveCLLocPtr = iPtr->scriptCLLocPtr;
ContLineLoc *clLocPtr = TclContinuationsGet(objPtr);
+ assert(invoker == NULL);
+
if (clLocPtr) {
iPtr->scriptCLLocPtr = clLocPtr;
Tcl_Preserve(iPtr->scriptCLLocPtr);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 11e9920..f6072a1 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8774,13 +8774,15 @@ TclGetSrcInfoForPc(
{
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
- if (cfPtr->cmd == NULL) {
+ assert(cfPtr->type == TCL_LOCATION_BC);
+ assert(cfPtr->cmd == NULL);
+
cfPtr->cmd = GetSrcInfoForPc(
(unsigned char *) cfPtr->data.tebc.pc, codePtr,
&cfPtr->len, NULL, NULL);
- }
- if (cfPtr->cmd != NULL) {
+ assert(cfPtr->cmd != NULL);
+ {
/*
* We now have the command. We can get the srcOffset back and from
* there find the list of word locations for this command.