If it sees a longer chain, but it can't process it, then it knows something is wrong. It displays "WARNING: Displayed transactions may not be correct! You may need to upgrade." and makes most RPC commands return an error.
What sort of attack is this intended to protect against? If it sees a longer chain but can't process it, it should also fail to validate any of the transactions in that block, right?