fix #6896, RHS not properly returned on self-assignment