Fix issue with compiling a constant struct containing a string array in a local context.

This commit is contained in:
Christoffer Lerno
2024-12-31 16:45:10 +01:00
parent 322c70433b
commit a913f21c45
2 changed files with 4 additions and 0 deletions

View File

@@ -35,6 +35,7 @@
- Add check in formatter printing "%c".
- Fix bug where `!!` and `!` was not recognized to jump out of the current scope.
- Fix bug when including compile time parameters in trailing body more than once.
- Fix issue with compiling a constant struct containing a string array in a local context.
### Stdlib changes
- Increase BitWriter.write_bits limit up to 32 bits.

View File

@@ -7251,7 +7251,10 @@ static void llvm_emit_default_arg(GenContext *c, BEValue *value, Expr *expr)
void llvm_emit_expr_global_value(GenContext *c, BEValue *value, Expr *expr)
{
sema_cast_const(expr);
LLVMBuilderRef b = c->builder;
c->builder = c->global_builder;
llvm_emit_expr(c, value, expr);
c->builder = b;
ASSERT0(!llvm_value_is_addr(value));
}