metasm/gui/dasm_hex.rb in metasm-1.0.3 vs metasm/gui/dasm_hex.rb in metasm-1.0.4
- old
+ new
@@ -25,11 +25,11 @@
@x_data = 7
@caret_x_data = 0
@oldcaret_x_data = 42
@focus_zone = @oldfocus_zone = :hex
@addr_min = @dasm.sections.keys.grep(Integer).min rescue nil
- @addr_max = @dasm.sections.map { |s, e| s + e.length }.max rescue nil
+ @addr_max = @dasm.sections.select { |s, _| s.kind_of?(Integer) }.map { |s, e| s + e.length }.max rescue nil
@view_addr = @dasm.prog_binding['entrypoint'] || @addr_min || 0
@show_address = @show_data = @show_ascii = true
@data_size = 1
@line_size = 16
@num_lines = 2 # height of widget in lines
@@ -536,10 +536,10 @@
@view_addr + @caret_y.to_i*@line_size + @caret_x.to_i
end
def gui_update
@addr_min = @dasm.sections.keys.grep(Integer).min rescue nil
- @addr_max = @dasm.sections.map { |s, e| s + e.length }.max rescue nil
+ @addr_max = @dasm.sections.select { |s, _| s.kind_of?(Integer) }.map { |s, e| s + e.length }.max rescue nil
@raw_data_cache.clear
redraw
end
end
end