Open Bug 550897 Opened 10 years ago Updated 2 years ago

unreachable code in nsCSSRendering::PaintDecorationLine

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set

Tracking

()

UNCONFIRMED

People

(Reporter: timeless, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

I'm aware this code is defense in depth, however, i'm not sure that it's necessary, as the coders who work on this are fairly responsible/reliable. it might be better to add a comment near 3198/3248+3258/3357 noting that there are a pair of switches.

3166 nsCSSRendering::PaintDecorationLine(gfxContext* aGfxContext,

3198   switch (aStyle) {
3199     case DECORATION_STYLE_SOLID:
3200     case DECORATION_STYLE_DOUBLE:
3203       break;
3204     case DECORATION_STYLE_DASHED: {
3214       break;
3216     case DECORATION_STYLE_DOTTED: {
3233       break;
3235     case DECORATION_STYLE_WAVY:
3247       break;
3248     default:

this NS_ERROR and the return that follows will exclude any value not handled above.

3249       NS_ERROR("Invalid style value!");
3250       return;

3258   switch (aStyle) {
3259     case DECORATION_STYLE_SOLID:
3264       break;
3265     case DECORATION_STYLE_DOUBLE:
3287       break;
3288     case DECORATION_STYLE_DOTTED:
3289     case DECORATION_STYLE_DASHED:
3294       break;
3295     case DECORATION_STYLE_WAVY: {
3352       break;

this is currently unreachable because of 3249/3250
3354     default:
3355       NS_ERROR("Invalid style value!");
3356       break;
You need to log in before you can comment on or make changes to this bug.