We should not call getFieldOffset on invalid record decls.
thanks for doing this !
i think we should bail out for invalid decls in here too. it won't crash but will provide spurious results. so i think an early exit for ND.isInvalidDecl() at the beginning of the function would be nice.
could you move this out of the if statement.