graydon/rust — pull request #1142 by jwise (2011-11-07 08:50:50+00:00)
Title: llvm::mk_object_file to option type (fixes OS X crash)

llvm::mk_object_file should really return an option, since the underlying LLVM function can fail. Fixes a crash on OS X when rust has bad dylibs within eyeshot.

Probably other functions throughout the llvm bindings should also have option types returned when they could potentially return null from LLVM -- but this is at least enough to fix a crash in which a "bad" dylib (i.e., one that LLVM can't parse) causes rustc to crash.