From 1ace8b6a76cad5a822571d05a3166674e4b0901a Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 10 May 2012 00:31:50 +0000 Subject: [PATCH] ExecutionEngine: Check for NULL ErrorStr before using it. Patch by Yury Mikhaylov . llvm-svn: 156523 --- llvm/lib/ExecutionEngine/TargetSelect.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/ExecutionEngine/TargetSelect.cpp b/llvm/lib/ExecutionEngine/TargetSelect.cpp index 42364f9b70f7..d3f830e672d9 100644 --- a/llvm/lib/ExecutionEngine/TargetSelect.cpp +++ b/llvm/lib/ExecutionEngine/TargetSelect.cpp @@ -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; }