Skip to content

Commit

Permalink
[Truffle] Fixed a bad offset in the 'string_chr_at' primitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Mar 31, 2015
1 parent 46a29c2 commit 2b4851a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/string/chomp_tags.txt
@@ -1,6 +1,4 @@
fails:String#chomp removes the final carriage return, newline from a multibyte String
fails:String#chomp removes the final carriage return, newline from a non-ASCII String
fails:String#chomp removes the final carriage return, newline from a non-ASCII String when the record separator is changed
fails:String#chomp! removes the final carriage return, newline from a multibyte String
fails:String#chomp! removes the final carriage return, newline from a non-ASCII String
fails:String#chomp! removes the final carriage return, newline from a non-ASCII String when the record separator is changed
Expand Up @@ -328,8 +328,8 @@ public Object stringChrAt(RubyString string, int byteIndex) {
return nil();
}

final int p = bytes.getBegin();
final int end = p + bytes.getRealSize();
final int p = bytes.getBegin() + byteIndex;
final int end = bytes.getBegin() + bytes.getRealSize();
final int c = StringSupport.preciseLength(bytes.getEncoding(), bytes.getUnsafeBytes(), p, end);

if (! StringSupport.MBCLEN_CHARFOUND_P(c)) {
Expand Down

0 comments on commit 2b4851a

Please sign in to comment.