fix Issue 12498 - ICE: while(string) causes compiler to crash during CTFE
Add assertion to detect internal failure in early stage
Merge pull request #3422 from 9rnsr/fix12498

Issue 12498 - ICE: while(string) causes compiler to crash during CTFE