Class: SeccompTools::Instruction::MISC
- Defined in:
- lib/seccomp-tools/instruction/misc.rb
Overview
Instruction misc, copies a value between the A and X registers.
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_MODE_STRICT, Const::BPF::SECCOMP_RET_ACTION_FULL, Const::BPF::SECCOMP_RET_DATA, Const::BPF::SECCOMP_SET_MODE_FILTER, Const::BPF::SECCOMP_SET_MODE_STRICT, Const::BPF::SIZEOF_SECCOMP_DATA, Const::BPF::SRC
Instance Method Summary collapse
-
#branch(state) ⇒ Array<(Integer, Symbolic::State)>
See Base#branch.
-
#decompile ⇒ String
Decompile instruction.
-
#symbolize ⇒ [:misc, (:tax, :txa)]
See Base#symbolize.
Methods inherited from Base
Methods included from Const::BPF
Constructor Details
This class inherits a constructor from SeccompTools::Instruction::Base
Instance Method Details
#branch(state) ⇒ Array<(Integer, Symbolic::State)>
See Base#branch.
31 32 33 34 35 36 |
# File 'lib/seccomp-tools/instruction/misc.rb', line 31 def branch(state) case op when :txa then [[line + 1, state.with(a: state.x)]] when :tax then [[line + 1, state.with(x: state.a)]] end end |
#decompile ⇒ String
Decompile instruction.
12 13 14 15 16 17 |
# File 'lib/seccomp-tools/instruction/misc.rb', line 12 def decompile case op when :txa then 'A = X' when :tax then 'X = A' end end |
#symbolize ⇒ [:misc, (:tax, :txa)]
See Base#symbolize.
22 23 24 |
# File 'lib/seccomp-tools/instruction/misc.rb', line 22 def symbolize [:misc, op] end |