|
|
|
|
|
by _flux
897 days ago
|
|
But you still need to pay attention to use overflow checking versions of functions when doing arithmetics, because in release mode regular integers are not overflow-checked at runtime, unless you explicitly enable -C overflow-checks=true—whichin my opinion would be a good default for many non-performance-critical applications. Arguably it's the "pay attention" part that causes the bug in the first place, so I don't think the performance-oriented default was a good pick. The issue is mitigated a bit by the remaining runtime array bounds checks, but I must wonder if those checks could be removed by the optimizer when it believes e.g. a variable can never be below a certain value. |
|