Re:Don’t assume that safety comes for free: a Swift case study
by nickpsecurity on Tuesday December 06, 2016 @06:33PM
(#13119225)
Exactly. This is what Ada and annotation-based verification do. Usually, there's bad input at one of the interface points (esp function calls or I/O) where some conditional checks can catch it. Not always but most cases.
If you're going to take the overhead of range checking for a value, it may as well be a more appropriate range, not just for overflow conditions...
Thinking it would be nice to be able to specify this as part of the type...