diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-07-12 18:04:33 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-07-12 18:04:33 (GMT) |
commit | 02457f7d6507f76fac8b308899e6592ab8214cb3 (patch) | |
tree | 84e622e144e045fb36d18b1ef70c6561ee1a920f /generic/tclExecute.c | |
parent | fde10a8fbff3c774f95f668f51b6d60c1489d50d (diff) | |
download | tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.zip tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.tar.gz tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.tar.bz2 |
Fix [Bug 2637173] by consolidating bytearray purity check.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 6c89523..aac36da 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -14,7 +14,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.439 2009/06/03 23:12:11 das Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.440 2009/07/12 18:04:33 dkf Exp $ */ #include "tclInt.h" @@ -4516,8 +4516,8 @@ TclExecuteByteCode( */ iResult = s1len = s2len = 0; - } else if ((valuePtr->typePtr == &tclByteArrayType) - && (value2Ptr->typePtr == &tclByteArrayType)) { + } else if (TclIsPureByteArray(valuePtr) + && TclIsPureByteArray(value2Ptr)) { s1 = (char *) Tcl_GetByteArrayFromObj(valuePtr, &s1len); s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len); iResult = memcmp(s1, s2, @@ -4635,7 +4635,7 @@ TclExecuteByteCode( } if ((index >= 0) && (index < length)) { - if (valuePtr->typePtr == &tclByteArrayType) { + if (TclIsPureByteArray(valuePtr)) { objResultPtr = Tcl_NewByteArrayObj( Tcl_GetByteArrayFromObj(valuePtr, &length)+index, 1); } else if (valuePtr->bytes && length == valuePtr->length) { @@ -4687,7 +4687,7 @@ TclExecuteByteCode( ustring2 = Tcl_GetUnicodeFromObj(value2Ptr, &length2); match = TclUniCharMatch(ustring1, length1, ustring2, length2, nocase); - } else if ((valuePtr->typePtr == &tclByteArrayType) && !nocase) { + } else if (TclIsPureByteArray(valuePtr) && !nocase) { unsigned char *string1, *string2; int length1, length2; |