Re:Remote code execution vulnerability in SQLite
by breckuh on Friday December 14, 2018 @08:47PM
(#18686517)
Can't you just have a NonZeroInt type?
[ Parent
| on HN ]
Re:Remote code execution vulnerability in SQLite
by whyonearth on Friday December 14, 2018 @08:58PM
(#18686553)
Only if your language supports dependent types.
Re:Remote code execution vulnerability in SQLite
by tonyg on Saturday December 15, 2018 @10:47AM
(#18688778)
It's perfectly possible in languages with ordinary ADTs.
data Nat = Z | S Nat
data NonZeroNat = OnePlus Nat
data NonZeroInt = Negative NonZeroNat | Positive NonZeroNat
Re:Remote code execution vulnerability in SQLite
by jwatte on Sunday December 16, 2018 @12:46PM
(#18694109)
C isn't one of those languages, though.
Re:Remote code execution vulnerability in SQLite
by tonyg on Monday December 17, 2018 @03:47PM
(#18702049)
The analogous would be the Go-style represent-a-sum-badly-as-a-product,
struct nonzero_t {
int is_negative;
unsigned int one_less_than_the_absolute_value;
};
which, under interpretation, ranges from -(2^32) to -1 and +1 to +(2^32).