Attachment "tclExecute.c.diff" to
ticket [1522510fff]
added by
fridolin
2006-07-27 14:56:53.
*** tclExecute.c.orig 2006-07-27 09:50:29.000000000 +0200
--- tclExecute.c 2006-07-27 09:51:45.000000000 +0200
***************
*** 726,761 ****
char *string;
int length, i, result;
- /*
- * First handle some common expressions specially.
- */
- string = Tcl_GetStringFromObj(objPtr, &length);
- if (length == 1) {
- if (*string == '0') {
- TclNewBooleanObj(resultPtr, 0);
- Tcl_IncrRefCount(resultPtr);
- *resultPtrPtr = resultPtr;
- return TCL_OK;
- } else if (*string == '1') {
- TclNewBooleanObj(resultPtr, 1);
- Tcl_IncrRefCount(resultPtr);
- *resultPtrPtr = resultPtr;
- return TCL_OK;
- }
- } else if ((length == 2) && (*string == '!')) {
- if (*(string+1) == '0') {
- TclNewBooleanObj(resultPtr, 1);
- Tcl_IncrRefCount(resultPtr);
- *resultPtrPtr = resultPtr;
- return TCL_OK;
- } else if (*(string+1) == '1') {
- TclNewBooleanObj(resultPtr, 0);
- Tcl_IncrRefCount(resultPtr);
- *resultPtrPtr = resultPtr;
- return TCL_OK;
- }
- }
/*
* Get the ByteCode from the object. If it exists, make sure it hasn't
--- 726,732 ----
***************
*** 782,789 ****
objPtr->typePtr = (Tcl_ObjType *) NULL;
}
}
! }
if (objPtr->typePtr != &tclByteCodeType) {
TclInitCompileEnv(interp, &compEnv, string, length);
result = TclCompileExpr(interp, string, length, &compEnv);
--- 753,797 ----
objPtr->typePtr = (Tcl_ObjType *) NULL;
}
}
! }
!
if (objPtr->typePtr != &tclByteCodeType) {
+
+ /*
+ * First handle some common expressions specially.
+ */
+
+ string = Tcl_GetStringFromObj(objPtr, &length);
+ if (length == 1) {
+ if (*string == '0') {
+ TclNewBooleanObj(resultPtr, 0);
+ Tcl_IncrRefCount(resultPtr);
+ *resultPtrPtr = resultPtr;
+ return TCL_OK;
+ } else if (*string == '1') {
+ TclNewBooleanObj(resultPtr, 1);
+ Tcl_IncrRefCount(resultPtr);
+ *resultPtrPtr = resultPtr;
+ return TCL_OK;
+ }
+ } else if ((length == 2) && (*string == '!')) {
+ if (*(string+1) == '0') {
+ TclNewBooleanObj(resultPtr, 1);
+ Tcl_IncrRefCount(resultPtr);
+ *resultPtrPtr = resultPtr;
+ return TCL_OK;
+ } else if (*(string+1) == '1') {
+ TclNewBooleanObj(resultPtr, 0);
+ Tcl_IncrRefCount(resultPtr);
+ *resultPtrPtr = resultPtr;
+ return TCL_OK;
+ }
+ }
+
+
+
+
+
TclInitCompileEnv(interp, &compEnv, string, length);
result = TclCompileExpr(interp, string, length, &compEnv);