do not emit code after a switch; fixes #946