Skip to content

Commit

Permalink
Fix: MachO#read_section? doesn't reset seek position
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Apr 13, 2017
1 parent 39c1620 commit 321f504
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/debug/mach_o.cr
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ module Debug
def ==(other : UUID)
bytes == other.bytes
end

def inspect(io)
io << bytes.to_slice.hexstring
end
end

struct Section64
Expand Down Expand Up @@ -490,8 +494,9 @@ module Debug

def read_section?(name)
if sh = sections.find { |s| s.sectname == name }
@io.seek(sh.offset)
yield sh, @io
@io.seek(sh.offset) do
yield sh, @io
end
end
end
end
Expand Down

0 comments on commit 321f504

Please sign in to comment.