Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unshare string when modified

  • Loading branch information...
commit 6b862e2abb7566c20bb02943047fbd6414ef4da8 1 parent 9653426
@dbussink dbussink authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  vm/builtin/string.cpp
View
2  vm/builtin/string.cpp
@@ -980,7 +980,9 @@ namespace rubinius {
}
if(lim > 0 && byte_size() > lim) {
+ unshare(state);
num_bytes(state, Fixnum::from(lim));
+ num_chars(state, nil<Fixnum>());
byte_address()[byte_size()] = 0;
}
return num_bytes();
Please sign in to comment.
Something went wrong with that request. Please try again.