fix one more crash

check the validity of the source location pointed
by a function's TypeLoc