diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-04-02 14:21:52 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-04-02 14:21:52 +0200 |
| commit | 10bde208502490371c42b5136d40d7d0cadef3cb (patch) | |
| tree | 77d23618e225449994272d366d195d257d4d1e28 /src | |
| parent | cc61fdd90e4447cb288d91f81e3832bd3e8ba1e0 (diff) | |
Fix #4980
Add nullptr check.
Diffstat (limited to 'src')
| -rw-r--r-- | src/llvm_backend_const.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp index 5587a298a..9401e4d55 100644 --- a/src/llvm_backend_const.cpp +++ b/src/llvm_backend_const.cpp @@ -33,7 +33,7 @@ gb_internal bool lb_is_elem_const(Ast *elem, Type *elem_type) { gb_internal bool lb_is_const_nil(lbValue value) { LLVMValueRef v = value.value; - if (LLVMIsConstant(v)) { + if (v != nullptr && LLVMIsConstant(v)) { if (LLVMIsAConstantAggregateZero(v)) { return true; } else if (LLVMIsAConstantPointerNull(v)) { |