If an error has occurred a symbol may have a DeclTypeSpec but no
valid DynamicType. There is no need to compute the size of erroneous
symbols.
Also, we only need to process object entities and procedure entities.
All other kinds of symbols can be skipped.
This fixes another problem revealed by https://bugs.llvm.org/show_bug.cgi?id=47265