diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2005-10-10 17:59:37 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2005-10-10 17:59:37 (GMT) |
commit | 876e0a64558dd715ec43f41dbc8ae7c7438e96ed (patch) | |
tree | 2875131a5be0128fca9ed2b6d414b8295dd37fee | |
parent | 2e093041b6542fddc7628829bea7e3ce6aad2bbd (diff) | |
download | tcl-msofer_wcodes_branch.zip tcl-msofer_wcodes_branch.tar.gz tcl-msofer_wcodes_branch.tar.bz2 |
* generic/tclExecute.c: fixing an error in INST_LNOT and
msofer_wcodes_branch
INST_LYES. Interestingly, the error only appeared in debug builds,
but I can't figure out how it matters.
* generic/tclCompile.c (OptReduceCount): improved panic message.
*** NOTE: disabling the optimiser causes a panic in normal builds,
but is ok in debug builds. Something is very fishy.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tclCompile.c | 6 | ||||
-rw-r--r-- | generic/tclExecute.c | 6 |
3 files changed, 20 insertions, 3 deletions
@@ -1,3 +1,14 @@ +2005-10-10 Miguel Sofer <msofer@users.sf.net> + + * generic/tclExecute.c: fixing an error in INST_LNOT and + INST_LYES. Interestingly, the error only appeared in debug builds, + but I can't figure out how it matters. + + * generic/tclCompile.c (OptReduceCount): improved panic message. + + *** NOTE: disabling the optimiser causes a panic in normal builds, + but is ok in debug builds. Something is very fishy. + 2005-10-09 Miguel Sofer <msofer@users.sf.net> * generic/tclCmdIL.c: diff --git a/generic/tclCompile.c b/generic/tclCompile.c index ad1f243..1b0ad37 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.81.2.25 2005/06/13 01:45:45 msofer Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.81.2.26 2005/10/10 17:59:38 msofer Exp $ */ #include "tclInt.h" @@ -3711,6 +3711,7 @@ OptimiseByteCodeTmp(codePtr) continue; } } + /* * If some range became unreachable, remove the extra reference to the * break and continue targets. @@ -3847,6 +3848,9 @@ OptReduceCount(codePtr, pos, auxCount) */ if (auxCount[pos] < 0) { +#ifdef TCL_COMPILE_DEBUG + TclPrintInstruction(codePtr, codeStart+pos); +#endif Tcl_Panic("Reducing auxCount of unreachable code."); } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2864945..2f1fade 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.171.2.30 2005/06/13 01:46:05 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.171.2.31 2005/10/10 17:59:38 msofer Exp $ */ #include "tclInt.h" @@ -860,7 +860,9 @@ Tcl_ExprObj(interp, objPtr, resultPtrPtr) TclEmitInst0(INST_DONE, &compEnv); TclInitByteCodeObj(objPtr, &compEnv); +#if VM_ENABLE_OPTIMISER TclOptimiseByteCode (interp, objPtr); +#endif TclFreeCompileEnv(&compEnv); codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; #ifdef TCL_COMPILE_DEBUG @@ -4049,7 +4051,7 @@ TclExecuteByteCode(interp, codePtr) NEXT_INST_F(0, 0); } } else { /* inst is INST_LNOT or INST_LYES*/ - if (tPtr == &tclIntType) { + if ((tPtr == &tclIntType) || (tPtr == &tclBooleanType)){ i = valuePtr->internalRep.longValue; TRACE_WITH_OBJ(("%ld => ", i), objResultPtr); } else if (tPtr == &tclWideIntType) { |