shorten_unambiguous_ref(): avoid integer truncation