Undefined behavior happens when casting string to bool

Thanks for your reply! As we have this convention, I agree that fixing this bug in tir.cast will be more proper. I will send a PR to enhance the check of casting.