Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added traits -- a path of matchers and commons

  • Loading branch information...
commit d51bc5ff3ed72cc68b182035b9e485ef540a06ff 1 parent 8fdece1
@farcaller farcaller authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/indis-arm/ual_loader.rb
View
4 lib/indis-arm/ual_loader.rb
@@ -25,6 +25,7 @@ module ARM
class BadMatchError < RuntimeError; end
class Instruction
+ attr_reader :traits
attr_accessor :size, :mnemonic, :values, :operands, :sets_flags, :it_mnemonic
def initialize
@@ -32,6 +33,7 @@ def initialize
@values = {}
@operands = ''
@it_mnemonic = ''
+ @traits = []
end
def in_it?
@@ -72,12 +74,14 @@ def map_instruction(bytes, root)
private
def match(name, instr, bytes)
+ instr.traits << name
matcher = @matchers[name]
instance_exec(instr, bytes, &matcher.proc)
end
def common(*args)
cname = args.shift
+ args[0].traits << cname
instance_exec(*args, &@commons[cname])
end
Please sign in to comment.
Something went wrong with that request. Please try again.