diff options
-rw-r--r-- | lib/mjit/c_pointer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mjit/c_pointer.rb b/lib/mjit/c_pointer.rb index aadf80e804..ee0be54a3c 100644 --- a/lib/mjit/c_pointer.rb +++ b/lib/mjit/c_pointer.rb @@ -282,12 +282,12 @@ module RubyVM::MJIT # Dereference def * - byte = Fiddle::Pointer.new(@addr)[0, Fiddle::SIZEOF_CHAR].unpack('c').first + byte = Fiddle::Pointer.new(@addr)[0, Fiddle::SIZEOF_CHAR].unpack1('c') if @width == 1 bit = (1 & (byte >> @offset)) bit == 1 elsif @width <= 8 && @offset == 0 - bitmask = @width.times.map { |i| 1 << i }.sum + bitmask = @width.times.sum { |i| 1 << i } byte & bitmask else raise NotImplementedError.new("not-implemented bit field access: width=#{@width} offset=#{@offset}") |