diff options
| author | gingerBill <bill@gingerbill.org> | 2018-12-15 22:30:52 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-12-15 22:30:52 +0000 |
| commit | 34b6486361db1c0d4eb53821f857df28cc7acf40 (patch) | |
| tree | 25b364e5671594c486bd842bef46ae2e87407f09 /src/check_expr.cpp | |
| parent | 1ce90b2166747d374e140f2d7cad0a5749fbb11d (diff) | |
Fix constant out of bounds bug
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 231b5dd3f..97df8e3be 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2703,9 +2703,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+1; + 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; |