diff Objects/stringobject.c @ 33833:10512ceba30c legacy-trunk

SF bug #1054139: serious string hashing error in 2.4b1 _PyString_Resize() readied strings for mutation but did not invalidate the cached hash value.
author Raymond Hettinger <python@rcn.com>
date Tue, 26 Oct 2004 01:52:37 +0000
parents 03440272028c
children a4225cdc2047 0b8268e0d70e
line wrap: on
line diff
--- a/Objects/stringobject.c	Mon Oct 25 21:35:17 2004 +0000
+++ b/Objects/stringobject.c	Tue Oct 26 01:52:37 2004 +0000
@@ -3530,6 +3530,7 @@
 	sv = (PyStringObject *) *pv;
 	sv->ob_size = newsize;
 	sv->ob_sval[newsize] = '\0';
+	sv->ob_shash = -1;	/* invalidate cached hash value */
 	return 0;
 }