Make sure ScopedAliases doesn't crash when there's a dangling var ref. Fixes issue 1103
R=dimvar
Merge remote-tracking branch: upstream/master