diff options
| author | gingerBill <bill@gingerbill.org> | 2018-11-23 10:38:17 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-11-23 10:38:17 +0000 |
| commit | 4c2f03b1f26bf9d9ec986bb2284e4daa9b4a95aa (patch) | |
| tree | b0cb6643394a0df8b79ebdfde4a39a5dd7b227a4 /src/check_expr.cpp | |
| parent | 52dcaeb1e975a020cf38451d8a20b5fb75a4aa85 (diff) | |
Fix compile time bounds check test
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index dc2e44533..943b1972d 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2647,9 +2647,9 @@ bool check_index_value(CheckerContext *c, bool open_range, Ast *index_value, i64 if (value) *value = v; bool out_of_bounds = false; if (open_range) { - out_of_bounds = v > max_count; + out_of_bounds = v > max_count+1; } else { - out_of_bounds = v >= max_count; + out_of_bounds = v > max_count; } if (v < 0) { out_of_bounds = true; |