fix Issue 11822 -  switch causees ICE with  return and other stuff
Merge pull request #3081 from WalterBright/fix11822

fix Issue 11822 -  switch causes ICE with  return and other stuff