summaryrefslogtreecommitdiffstats
path: root/generic/tclCompExpr.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-05 22:13:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-05 22:13:30 (GMT)
commit69eed829d100f7dcbe449ef6854ae7d24f72179c (patch)
tree75bdcad5e3dd07490f2ff56d5d37a926d77e61a2 /generic/tclCompExpr.c
parent9e95ecd95bda273bf6f0b4c6b3816c6043b868ae (diff)
downloadtcl-69eed829d100f7dcbe449ef6854ae7d24f72179c.zip
tcl-69eed829d100f7dcbe449ef6854ae7d24f72179c.tar.gz
tcl-69eed829d100f7dcbe449ef6854ae7d24f72179c.tar.bz2
New internal routine TclFetchLiteral() for better CompileEnv encapsulation.
Diffstat (limited to 'generic/tclCompExpr.c')
-rw-r--r--generic/tclCompExpr.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 346f446..3597abe 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2445,14 +2445,11 @@ CompileExprTree(
Tcl_Obj *literal = *litObjv;
if (optimize) {
- int length, index;
+ int length;
const char *bytes = TclGetStringFromObj(literal, &length);
- LiteralEntry *lePtr;
- Tcl_Obj *objPtr;
-
- index = TclRegisterNewLiteral(envPtr, bytes, length);
- lePtr = envPtr->literalArrayPtr + index;
- objPtr = lePtr->objPtr;
+ int index = TclRegisterNewLiteral(envPtr, bytes, length);
+ Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
+
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
/*
* Would like to do this:
@@ -2511,7 +2508,7 @@ CompileExprTree(
index = TclRegisterNewLiteral(envPtr, objPtr->bytes,
objPtr->length);
- tableValue = envPtr->literalArrayPtr[index].objPtr;
+ tableValue = TclFetchLiteral(envPtr, index);
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*