Class: SeccompTools::Instruction::RET

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

Overview

Instruction ret.

Constant Summary

Constants included from Const::BPF

Const::BPF::ACTION, Const::BPF::COMMAND, Const::BPF::JMP, Const::BPF::MISCOP, Const::BPF::MODE, Const::BPF::OP, Const::BPF::PR_SET_SECCOMP, Const::BPF::SECCOMP_MODE_FILTER, Const::BPF::SECCOMP_RET_ACTION_FULL, Const::BPF::SECCOMP_RET_DATA, Const::BPF::SECCOMP_SET_MODE_FILTER, Const::BPF::SIZEOF_SECCOMP_DATA, Const::BPF::SRC

Instance Method Summary collapse

Methods inherited from Base

#initialize, #invalid

Constructor Details

This class inherits a constructor from SeccompTools::Instruction::Base

Instance Method Details

#branch[]

Returns:

  • ([])

    Always return an empty array.



23
24
25
# File 'lib/seccomp-tools/instruction/ret.rb', line 23

def branch(*)
  []
end

#decompileObject

Decompile instruction.



10
11
12
# File 'lib/seccomp-tools/instruction/ret.rb', line 10

def decompile
  "return #{ret_str}"
end

#symbolize[:ret, (:a, Integer)]

Returns:

  • ([:ret, (:a, Integer)])


16
17
18
# File 'lib/seccomp-tools/instruction/ret.rb', line 16

def symbolize
  [:ret, code & 0x18 == SRC[:a] ? :a : k]
end