Stack Issue

avoid relying on undefined behaviour #1004

Project opm-simulators