Writing my own LLVM client I’ve noticed a potential null pointer dereference in EngineBuilder::selectTarget.
The class has an optional pointer to the ErrorStr, which can be initialzied through setErrorStr() method. Although, it’s strictly optional, selectTarget doesn’t verify its value before assignment.
Please find patch for branch release_31, revision 155051 attached.
TargetSelect.patch (488 Bytes)