In git-head, using `te->sym->getMemtype(loc)` would be much better. The function is added by Walter very recently, and it handles forward references correctly as its API design.