only the first argument is checked against illegal out-of-bounds values (e.g. 0), whereas the second argument is not.
Calling this function with an illegal zero-valued second argument causes the whole Renoise application to crash.
Good one Xeryc. I’ve tried Linux Renoise 3.0b1 and yes it does crash Renoise with 0 in the second parameter of the function call. Don’t know if you want to make a post in the Renoise 3 beta bug reports forum section about this as (maybe) the devs would consider it a serious bug as you are getting a complete crash. (Well I know I would personally, I consider even the most slightest anomaly in my programs a bug, but still… )