mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
Fix broken rebase
This commit is contained in:
parent
9f8f1afba2
commit
e4a824f769
13 changed files with 12 additions and 135 deletions
|
@ -1,4 +1,4 @@
|
|||
module RubyVM::MJIT # :nodoc: all
|
||||
module RubyVM::MJIT
|
||||
# Every class under this namespace is a pointer. Even if the type is
|
||||
# immediate, it shouldn't be dereferenced until `*` is called.
|
||||
module CPointer
|
||||
|
@ -293,12 +293,12 @@ module RubyVM::MJIT # :nodoc: all
|
|||
|
||||
# Dereference
|
||||
def *
|
||||
byte = Fiddle::Pointer.new(@addr)[0, Fiddle::SIZEOF_CHAR].unpack1('c')
|
||||
byte = Fiddle::Pointer.new(@addr)[0, Fiddle::SIZEOF_CHAR].unpack('c').first
|
||||
if @width == 1
|
||||
bit = (1 & (byte >> @offset))
|
||||
bit == 1
|
||||
elsif @width <= 8 && @offset == 0
|
||||
bitmask = @width.times.sum { |i| 1 << i }
|
||||
bitmask = @width.times.map { |i| 1 << i }.sum
|
||||
byte & bitmask
|
||||
else
|
||||
raise NotImplementedError.new("not-implemented bit field access: width=#{@width} offset=#{@offset}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue