Browse Source

Merge pull request #4990 from Kelimion/fix-4980

Fix #4980
gingerBill 4 months ago
parent
commit
c6b6dddccc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/llvm_backend_const.cpp

+ 1 - 1
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) {
 gb_internal bool lb_is_const_nil(lbValue value) {
 	LLVMValueRef v = value.value;
 	LLVMValueRef v = value.value;
-	if (LLVMIsConstant(v)) {
+	if (v != nullptr && LLVMIsConstant(v)) {
 		if (LLVMIsAConstantAggregateZero(v)) {
 		if (LLVMIsAConstantAggregateZero(v)) {
 			return true;
 			return true;
 		} else if (LLVMIsAConstantPointerNull(v)) {
 		} else if (LLVMIsAConstantPointerNull(v)) {