Fix clone_constant_impl to correctly deal with null pointers
authoraqjune <aqjune@gmail.com>
Tue, 5 Nov 2019 04:26:51 +0000 (13:26 +0900)
committeraqjune <aqjune@gmail.com>
Tue, 5 Nov 2019 04:53:52 +0000 (13:53 +0900)
commit31be9f3f7dee80c586d3beac9a65663d5628cf96
treea88651f3e38b337ab1e27ba8e9da40181bbbd233
parent0aba69eb1a01c44185009f50cc633e3c648e9950
Fix clone_constant_impl to correctly deal with null pointers

Summary:
This patch resolves llvm-c-test's following error

```
LLVM ERROR: LLVMGetValueKind returned incorrect type
```

which arises when the input bitcode contains a null pointer.

Reviewers: jdoerfert, CodaFi, deadalnix

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68928
llvm/test/Bindings/llvm-c/echo.ll
llvm/tools/llvm-c-test/echo.cpp