diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-28 15:30:23 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-28 15:30:23 +0000 |
| commit | 37c2f6882419c8811d9fc9238873668b82a40a04 (patch) | |
| tree | ffbeb99d0bd774efc77dce846f84d7916c0bf1d8 /src/check_stmt.cpp | |
| parent | 16881e256d5512024dfc85eea2c324cc4241bd99 (diff) | |
Allow #unroll for arrays of fixed length which are not constants
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 835f0162a..2dc621a84 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1027,7 +1027,9 @@ gb_internal void check_unroll_range_stmt(CheckerContext *ctx, Ast *node, u32 mod error(operand.expr, "Cannot iterate over '%s' of type '%s' in an '#unroll for' statement", s, t); gb_string_free(t); gb_string_free(s); - } else if (operand.mode != Addressing_Constant && unroll_count <= 0) { + } else if (operand.mode != Addressing_Constant && ( + unroll_count <= 0 && + compare_exact_values(Token_CmpEq, inline_for_depth, exact_value_i64(0)))) { error(operand.expr, "An '#unroll for' expression must be known at compile time"); } } |