Method: Fisk::Helpers::JITBuffer#patch_jump

Defined in:
lib/fisk/helpers.rb

#patch_jump(at:, to:, type: :jmp) ⇒ Object

Write a jump instruction at location at that jumps to the location specified by to. type specifies the type of jump. This method maintains the current position of the cursor inside the memory chunk



81
82
83
84
85
# File 'lib/fisk/helpers.rb', line 81

def patch_jump at:, to:, type: :jmp
  pos = self.pos
  write_jump(to: to, at: at, type: type)
  seek pos, IO::SEEK_SET
end