Class: SeccompTools::Asm::Scalar::Base

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

Overview

To be used to denote a register (A / X), an argument (data), or a memory data (mem).

Every predicate returns false here, each subclass overrides exactly the one that identifies it. The registers and len carry no payload and are singletons, the remaining subclasses keep theirs in #val.

Direct Known Subclasses

A, ConstVal, Data, Len, Mem, X

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valInteger? (readonly)

Returns The payload of this scalar, whose meaning depends on the subclass: the immediate value for ConstVal, the index for Data and Mem. nil for the singletons.

Returns:

  • (Integer?)

    The payload of this scalar, whose meaning depends on the subclass: the immediate value for ConstVal, the index for Data and Mem. nil for the singletons.



21
22
23
# File 'lib/seccomp-tools/asm/scalar.rb', line 21

def val
  @val
end

Instance Method Details

#a?Boolean

Is this the A register?

Returns:

  • (Boolean)


25
26
27
# File 'lib/seccomp-tools/asm/scalar.rb', line 25

def a?
  false
end

#const?Boolean

Is this a constant value?

Returns:

  • (Boolean)


55
56
57
# File 'lib/seccomp-tools/asm/scalar.rb', line 55

def const?
  false
end

#data?Boolean

Is this a data[] access?

Returns:

  • (Boolean)


43
44
45
# File 'lib/seccomp-tools/asm/scalar.rb', line 43

def data?
  false
end

#len?Boolean

Is this len?

Returns:

  • (Boolean)


37
38
39
# File 'lib/seccomp-tools/asm/scalar.rb', line 37

def len?
  false
end

#mem?Boolean

Is this a mem[] access?

Returns:

  • (Boolean)


49
50
51
# File 'lib/seccomp-tools/asm/scalar.rb', line 49

def mem?
  false
end

#x?Boolean

Is this the X register?

Returns:

  • (Boolean)


31
32
33
# File 'lib/seccomp-tools/asm/scalar.rb', line 31

def x?
  false
end