summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-07-10 16:27:09 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-07-10 16:27:09 (GMT)
commit55deb86ee331985bbfedb4d5211968c4dbe1decd (patch)
tree5f49a192af44a9205c248cd624f48015381d8bae
parent79cd9409e13c0854f7eb3f04d970e44b30c3ec7d (diff)
downloadtcl-55deb86ee331985bbfedb4d5211968c4dbe1decd.zip
tcl-55deb86ee331985bbfedb4d5211968c4dbe1decd.tar.gz
tcl-55deb86ee331985bbfedb4d5211968c4dbe1decd.tar.bz2
First additional test. Remove dup macros in tclEnsemble.c.
-rw-r--r--generic/tclCompCmds.c2
-rw-r--r--generic/tclCompCmdsGR.c4
-rw-r--r--generic/tclCompCmdsSZ.c4
-rw-r--r--generic/tclCompile.h6
-rw-r--r--generic/tclEnsemble.c10
-rw-r--r--tests/info.test15
6 files changed, 21 insertions, 20 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index fddf152..7ed9006 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -610,7 +610,7 @@ TclCompileCatchCmd(
* begin by undeflowing the stack below the mark set by BEGIN_CATCH4.
*/
- SetLineInformation(1);
+ LineInformation(1);
if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 3cd0da6..cc3f694 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -264,9 +264,7 @@ TclCompileIfCmd(
*/
if (compileScripts) {
- SetLineInformation(wordIdx);
-envPtr->line = mapPtr->loc[eclIndex].line[wordIdx];
-envPtr->clNext = mapPtr->loc[eclIndex].next[wordIdx];
+ LineInformation(wordIdx);
CompileBody(envPtr, tokenPtr, interp);
}
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 8723a4f..34c24f9 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -725,9 +725,7 @@ TclCompileSubstCmd(
return TCL_ERROR;
}
- SetLineInformation(numArgs);
-envPtr->line = mapPtr->loc[eclIndex].line[numArgs];
-envPtr->clNext = mapPtr->loc[eclIndex].next[numArgs];
+ LineInformation(numArgs);
TclSubstCompile(interp, wordTokenPtr[1].start, wordTokenPtr[1].size,
flags, mapPtr->loc[eclIndex].line[numArgs], envPtr);
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 6fe14f2..5043f65 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -1537,9 +1537,9 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
int eclIndex = mapPtr->nuloc - 1
-//#define SetLineInformation(word) \
-// envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
-// envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
+#define LineInformation(word) \
+ envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
+ envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
#define SetLineInformation(word)
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 813e056..e0aa0c4 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -88,16 +88,6 @@ const Tcl_ObjType tclEnsembleCmdType = {
NULL /* setFromAnyProc */
};
-/*
- * Copied from tclCompCmds.c
- */
-
-#define DefineLineInformation \
- ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
- int eclIndex = mapPtr->nuloc - 1
-#define SetLineInformation(word) \
- envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
- envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
static inline Tcl_Obj *
NewNsObj(
diff --git a/tests/info.test b/tests/info.test
index ebc853a..a1d3b1a 100644
--- a/tests/info.test
+++ b/tests/info.test
@@ -1962,6 +1962,21 @@ test info-9.13 {info level option, value in global context} -body {
} -returnCodes error -result {bad level "2"}
# -------------------------------------------------------------------------
+namespace eval foo {}
+proc foo::bar {} {
+ catch {*}{
+ {info frame 0}
+ res
+ }
+ return $res
+}
+test info-33.4 {{*}, literal, simple, bytecompiled} -body {
+ reduce [foo::bar]
+} -cleanup {
+ namespace delete foo
+} -result {type source line 1968 file info.test cmd {info frame 0} proc ::foo::bar level 0}
+
+# -------------------------------------------------------------------------
unset -nocomplain res
# cleanup