[sgen] Fix scanning of large arrays (#7672)