Merge pull request #3141 from 9rnsr/fix11974

Issue 11974 - ICE(cast.c) Segfault with invalid assignment