Skip to content

Commit

Permalink
Also pass keyword arguments from method_missing to instruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Feb 18, 2025
1 parent a395f7c commit d9d6402
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ronin/asm/program.rb
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,17 @@ def assemble(output, syntax: :intel, format: :bin)
# @param [Array] arguments
# Additional operands.
#
def method_missing(name,*arguments,&block)
if (block && arguments.empty?)
# @param [Hash{Symbol => Object}] kwargs
# Additional keyword arguments.
#
def method_missing(name,*arguments,**kwargs,&block)
if (block && arguments.empty? && kwargs.empty?)
label(name,&block)
elsif block.nil?
if (arguments.empty? && register?(name))
register(name)
else
instruction(name,*arguments)
instruction(name,*arguments,**kwargs)
end
else
super(name,*arguments,&block)
Expand Down

0 comments on commit d9d6402

Please sign in to comment.