[Beignet] [PATCH] Fix a segment fault.
Yang Rong
rong.r.yang at intel.com
Wed Oct 8 22:56:52 PDT 2014
llvm::CallInst::CallInst::getCalledFunction may return NULL, can't call getIntrinsicID
directly.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
backend/src/llvm/llvm_bitcode_link.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
index 1365b32..7ef6a8a 100644
--- a/backend/src/llvm/llvm_bitcode_link.cpp
+++ b/backend/src/llvm/llvm_bitcode_link.cpp
@@ -94,7 +94,8 @@ namespace gbe
continue;
}
- if (call->getCalledFunction()->getIntrinsicID() != 0)
+ if (call->getCalledFunction() &&
+ call->getCalledFunction()->getIntrinsicID() != 0)
continue;
Value *Callee = call->getCalledValue();
--
1.9.1
More information about the Beignet
mailing list