Skip to content

Instantly share code, notes, and snippets.

@mchung
Created September 25, 2008 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchung/12831 to your computer and use it in GitHub Desktop.
Save mchung/12831 to your computer and use it in GitHub Desktop.
# libxml-ruby segfault
require 'rubygems'
require 'xml'
def try(&block)
begin
yield if block_given?
rescue
puts "err: #{$!}"
end
end
f= XML::Parser.new
f.string = "<xml>foo</xml>"
try do
f.parse
end
try do
f.parse
end
try do
f.parse
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment