Fixed #5417 (ast: avoid hang when '({})' is used)