[Refactoring] Remove goto jumps
fix Issue 11888 - Incorrect behaviour taking slice from return value
Merge pull request #4026 from 9rnsr/fix11888

Issue 11888 - Incorrect behaviour taking slice from return value