You are doomed. There is no way to teleport out of a location (I will suggest that to the dev though since this is a game breaking bug) nor can you smash those rocks. Having the ability to break them would obviously kill the riddle.
You will have to start again, sorry.