diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-03-04 11:48:29 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-04 11:48:29 +0000 |
| commit | 07062324d71787e60c616ffb5d90ea18baa2fda5 (patch) | |
| tree | 0ebe6f8df9a2c375adcf9c3f9936a0a7a39e8247 /src/check_builtin.cpp | |
| parent | 2e8f2e6dbc0bd558d52668f778ad5c95772fddfd (diff) | |
| parent | a5dde78f0882cc6db0b329f356dc7345d47798ca (diff) | |
Merge pull request #1575 from jockus/fix_relative_slice_len
Add relative slice to type checks for built in len
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index aeeeb9e4d..365d3434f 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -952,7 +952,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 mode = Addressing_Constant; value = exact_value_i64(at->EnumeratedArray.count); type = t_untyped_integer; - } else if (is_type_slice(op_type) && id == BuiltinProc_len) { + } else if ((is_type_slice(op_type) || is_type_relative_slice(op_type)) && id == BuiltinProc_len) { mode = Addressing_Value; } else if (is_type_dynamic_array(op_type)) { mode = Addressing_Value; |