Those types of glasses do not provide adequate protection from sunlight, especially in areas with lots of reflective surfaces (desert, snow) and at high elevations where there's more UV radiation due to the thinner atmosphere above you.
What you want are either wrap-around glasses which don't let light in the sides, or particular glasses called "glacier glasses". Glacier glasses have a fabric/leather/plastic shield on the side which prevents light from coming in.

Your eyes will dilate slightly to allow more light in when you're wearing dark glasses, which compounds the issue - because your pupils are open wider, the potential for UV damage from light coming in the sides at full brightness is increased. You should always wear full wrap-around or glacier glasses when you're outdoors in areas with intense light and reflected surfaces, and especially at high elevations.