fix word indexes on arm
which affected offsets in the ruby side too the hidden dead word needed accounting for
This commit is contained in:
@ -139,7 +139,7 @@ module Parfait
|
||||
index = self.length + at if at < 0
|
||||
raise "index must be positive , not #{at}" if (index <= 0)
|
||||
raise "index too large #{at} > #{self.length}" if (index > self.length )
|
||||
return index + Word.get_length_index * 4
|
||||
return index + Word.get_length_index * 4 + 4
|
||||
end
|
||||
|
||||
# compare the word to another
|
||||
|
@ -1,11 +1,11 @@
|
||||
class Word < Object
|
||||
|
||||
int correct_index(int index)
|
||||
return index + 8
|
||||
int _internal_index(int index)
|
||||
return index + 12
|
||||
end
|
||||
|
||||
int char_at(int index)
|
||||
index = correct_index(index)
|
||||
int get_char_at(int index)
|
||||
index = _internal_index(index)
|
||||
return get_internal_byte(index)
|
||||
end
|
||||
|
||||
@ -15,7 +15,7 @@ class Word < Object
|
||||
end
|
||||
|
||||
int set_char_at( int index , int val)
|
||||
index = correct_index(index)
|
||||
index = _internal_index(index)
|
||||
return set_internal_byte(index , val)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user