This fixes an internal error in GAS, triggered by the test case reported in PR 16765.