Here is a patch to play with.
I also found a related typo.
One possible question for discussion is whether the default for this
should be off, on, or possibly something like on-in-assert-builds.
(Personally, I'm happy to turn it on myself at run time, but everyone
has different workflows.)