runtime: Turn on CheckForOverflowUnderflow on all projects in Debug

Right now, only System.Reflection.Metadata has CheckForOverflowUnderflow on in Debug.

I think there’s value in doing this across the board. Expressions that are allowed to overflow by design should be explicitly marked unchecked.

cc @weshaggard @stephentoub

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 37 (23 by maintainers)

Commits related to this issue

Most upvoted comments

thanks @dennisdietrich this is awesome!

Quick update: Including some code changes I haven’t committed yet I’m down to about 50 failing inner loop test projects on Windows so it’ll probably be a few more days until I’m done with that, after which I’ll take a look at running inner loop on Linux (and after that, obviously, I’ll check outer loop).

measure critical paths to ensure nothing regresses perf-wise

I am pretty sure that turning this on for release builds is non-starter.

If you do it across all projects, it’s very likely that there’d be a very large number of regressions, so you’d have to change all of those regressions, so it would likely be a massive one-shot PR. If you do it project by project it’s more likely to lead to small easier-to-review PRs, and then the setting could be moved up to being global after that.

If we enable this across the board and don’t see any errors

I’m 100% sure there will be errors / regressions if/when we enable this everywhere. 😉 That’s not to say we shouldn’t do it, but I don’t think it’s as simple as changing a build configuration entry.