Check for overflow in $GENERATE computations [v9_16]
$GENERATE uses 'int' for its computations and some constructions can overflow values that can be represented by an 'int' resulting in undefined behaviour. Detect these conditions and return a range error.
(cherry picked from commit 5327b970)
Closes #3429 (closed)
Edited by Mark Andrews