sval: make a typed version of get_value_ranges_sval()