[mycpp] Avoid crash with unreachable code (#2571)