llvm::CallInst::CallInst::getCalledFunction may return NULL, can't call 
getIntrinsicID
directly.

Signed-off-by: Yang Rong <[email protected]>
---
 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

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to