HPCC-12285 Fix set index ranges

Signed-off-by: JamieNoss <james.noss@lexisnexis.com>
Merge pull request #6505 from jamienoss/issue12285-set-range-seg-fault-_v1_

HPCC-12285 Fix set index ranges

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>