Class: SeccompTools::Asm::Scalar::Mem

Inherits:
Base
  • Object
show all
Defined in:
lib/seccomp-tools/asm/scalar.rb

Overview

A mem[] access, one slot of the scratch memory.

Instance Attribute Summary

Attributes inherited from Base

#val

Instance Method Summary collapse

Methods inherited from Base

#a?, #const?, #data?, #len?, #x?

Constructor Details

#initialize(index) ⇒ Mem

Instantiates a SeccompTools::Asm::Scalar::Mem object.

Parameters:

  • index (Integer)

    Index of the scratch memory slot.



152
153
154
155
# File 'lib/seccomp-tools/asm/scalar.rb', line 152

def initialize(index)
  @val = index
  super()
end

Instance Method Details

#==(other) ⇒ Boolean

Returns true only if other is a SeccompTools::Asm::Scalar::Mem with the same index.

Parameters:

  • other (Mem)

    The object to be compared with.

Returns:



161
162
163
# File 'lib/seccomp-tools/asm/scalar.rb', line 161

def ==(other)
  other.is_a?(Mem) && val == other.val
end

#mem?Boolean

Returns Always true.

Returns:

  • (Boolean)

    Always true.



166
167
168
# File 'lib/seccomp-tools/asm/scalar.rb', line 166

def mem?
  true
end