- *(int*)1 incorrectly yielded an assert in LLVM IR lowering #2584.

This commit is contained in:
Christoffer Lerno
2025-11-20 10:36:32 +01:00
parent 2a41fa6281
commit 39694e65c0
3 changed files with 8 additions and 1 deletions

View File

@@ -2371,7 +2371,7 @@ static inline void llvm_emit_deref(GenContext *c, BEValue *value, Expr *inner, T
llvm_emit_expr(c, value, inner);
llvm_value_rvalue(c, value);
AlignSize alignment = type_abi_alignment(type);
if (safe_mode_enabled())
if (safe_mode_enabled() && !expr_is_const(inner))
{
LLVMValueRef check = LLVMBuildICmp(c->builder, LLVMIntEQ, value->value, llvm_get_zero(c, inner->type), "checknull");
scratch_buffer_clear();