Fix scavenge_stack crash (#9045)