aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-04-02 14:21:52 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-04-02 14:21:52 +0200
commit10bde208502490371c42b5136d40d7d0cadef3cb (patch)
tree77d23618e225449994272d366d195d257d4d1e28 /src/llvm_backend_const.cpp
parentcc61fdd90e4447cb288d91f81e3832bd3e8ba1e0 (diff)
Fix #4980
Add nullptr check.
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp2
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)) {