ExecutionEngine: Check for NULL ErrorStr before using it.

Patch by Yury Mikhaylov <yury.mikhaylov@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2012-05-10 00:31:50 +00:00
parent 08dc5f2adb
commit 77966fab9e

View File

@ -56,8 +56,9 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
}
if (!TheTarget) {
*ErrorStr = "No available targets are compatible with this -march, "
"see -version for the available targets.\n";
if (ErrorStr)
*ErrorStr = "No available targets are compatible with this -march, "
"see -version for the available targets.\n";
return 0;
}