[sgen] Fix a toggleref array resize bug.