SI-7385 crash in erroneous code

Less crashing, more emitting errors.
SI-6091 overeager warning for reference equality

Don't warn on eq and ne unless they're the real eq or ne.
Merge pull request #2487 from paulp/issue/6091

SI-6091 overeager warning for reference equality
Merge pull request #2472 from paulp/pr/2.10.2/7385

SI-7385 crash in erroneous code