aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-06 17:33:38 +0100
committergingerBill <bill@gingerbill.org>2023-09-06 17:33:38 +0100
commitaaaff9b66ca10edd9cf76bb24463a7b16095325e (patch)
treec984778e1b98bf8c1ebc4728fc6290202091f050 /src/llvm_backend_const.cpp
parentc660b43105f34d54192527f2d052346213702dfa (diff)
Fix bug: Disallow non-specialized polymorphic in typeid assignment
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index 5c390a370..01b0528d0 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -1094,8 +1094,11 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo
}
if (is_constant) {
LLVMValueRef elem_value = lb_const_value(m, tav.type, tav.value, allow_local).value;
- GB_ASSERT(LLVMIsConstant(elem_value));
- values[index] = LLVMConstInsertValue(values[index], elem_value, idx_list, idx_list_len);
+ if (LLVMIsConstant(elem_value)) {
+ values[index] = LLVMConstInsertValue(values[index], elem_value, idx_list, idx_list_len);
+ } else {
+ is_constant = false;
+ }
}
}
}