We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 458a4fd commit df40f9fCopy full SHA for df40f9f
1 file changed
src/stringobj.c
@@ -1243,7 +1243,8 @@ Obj CopyToStringRep(
1243
copy = NEW_STRING(lenString);
1244
1245
if ( IS_STRING_REP(string) ) {
1246
- memcpy(ADDR_OBJ(copy), CONST_ADDR_OBJ(string), SIZE_OBJ(string));
+ memcpy(CHARS_STRING(copy), CONST_CHARS_STRING(string),
1247
+ GET_LEN_STRING(string));
1248
/* XXX no error checks? */
1249
} else {
1250
/* copy the string to the string representation */
@@ -1267,7 +1268,7 @@ Obj CopyToStringRep(
1267
1268
*/
1269
Obj ImmutableString(Obj string)
1270
{
- if (!IS_STRING_REP(string) || !IS_MUTABLE_OBJ(string)) {
1271
+ if (!IS_STRING_REP(string) || IS_MUTABLE_OBJ(string)) {
1272
string = CopyToStringRep(string);
1273
MakeImmutableString(string);
1274
}
0 commit comments