diff options
author | gahr <gahr@gahr.ch> | 2016-06-10 12:10:41 (GMT) |
---|---|---|
committer | gahr <gahr@gahr.ch> | 2016-06-10 12:10:41 (GMT) |
commit | 74cee16544d00f49288f1819fb71e1c5c74ce5ad (patch) | |
tree | d77bcc9fb09de474104b1fc59dde7cc6c20b4031 /generic/tclCompExpr.c | |
parent | 8377ed833a9566731442ef744b419425638d5040 (diff) | |
parent | 03462e2c1dfc9da26f049ee17a3001df257442e4 (diff) | |
download | tcl-74cee16544d00f49288f1819fb71e1c5c74ce5ad.zip tcl-74cee16544d00f49288f1819fb71e1c5c74ce5ad.tar.gz tcl-74cee16544d00f49288f1819fb71e1c5c74ce5ad.tar.bz2 |
Merge trunk
Diffstat (limited to 'generic/tclCompExpr.c')
-rw-r--r-- | generic/tclCompExpr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 50edbec..654666a 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -564,13 +564,13 @@ ParseExpr( { OpNode *nodes = NULL; /* Pointer to the OpNode storage array where * we build the parse tree. */ - int nodesAvailable = 64; /* Initial size of the storage array. This + unsigned int nodesAvailable = 64; /* Initial size of the storage array. This * value establishes a minimum tree memory * cost of only about 1 kibyte, and is large * enough for most expressions to parse with * no need for array growth and * reallocation. */ - int nodesUsed = 0; /* Number of OpNodes filled. */ + unsigned int nodesUsed = 0; /* Number of OpNodes filled. */ int scanned = 0; /* Capture number of byte scanned by parsing * routines. */ int lastParsed; /* Stores info about what the lexeme parsed @@ -662,7 +662,7 @@ ParseExpr( */ if (nodesUsed >= nodesAvailable) { - int size = nodesUsed * 2; + unsigned int size = nodesUsed * 2; OpNode *newPtr = NULL; do { @@ -2181,7 +2181,6 @@ ExecConstantExprTree( CompileEnv *envPtr; ByteCode *byteCodePtr; int code; - Tcl_Obj *byteCodeObj = Tcl_NewObj(); NRE_callback *rootPtr = TOP_CB(interp); /* @@ -2195,14 +2194,12 @@ ExecConstantExprTree( CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr, 0 /* optimize */); TclEmitOpcode(INST_DONE, envPtr); - Tcl_IncrRefCount(byteCodeObj); - TclInitByteCodeObj(byteCodeObj, envPtr); + byteCodePtr = TclInitByteCode(envPtr); TclFreeCompileEnv(envPtr); TclStackFree(interp, envPtr); - byteCodePtr = byteCodeObj->internalRep.twoPtrValue.ptr1; TclNRExecuteByteCode(interp, byteCodePtr); code = TclNRRunCallbacks(interp, TCL_OK, rootPtr); - Tcl_DecrRefCount(byteCodeObj); + TclReleaseByteCode(byteCodePtr); return code; } |