Closed Bug 1208861 Opened 10 years ago Closed 10 years ago

Possible copy-paste error in nsStyleClipPath::nsStyleClipPath()

Categories

(Core :: CSS Parsing and Computation, defect)

44 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1208901
Tracking Status
firefox44 --- affected

People

(Reporter: ssitter, Unassigned)

References

Details

(Whiteboard: [pvs-studio])

From http://www.viva64.com/en/b/0347/: PVS-Studio's diagnostic message: V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 1060, 1062. nsstylestruct.cpp 1060 nsStyleClipPath::nsStyleClipPath(const nsStyleClipPath& aSource) { if (aSource.mType == NS_STYLE_CLIP_PATH_URL) { SetURL(aSource.mURL); } else if (aSource.mType == NS_STYLE_CLIP_PATH_SHAPE) { SetBasicShape(aSource.mBasicShape, aSource.mSizingBox); } else if (aSource.mType == NS_STYLE_CLIP_PATH_SHAPE) { SetSizingBox(aSource.mSizingBox); } } The "if - else if" block contains a duplicated equality check, this error being caused by careless usage of the copy-paste method. It means that the last part of the code, corresponding to the second check for "NS_STYLE_CLIP_PATH_SHAPE", will never be executed.
Blocks: 1072894
Flags: needinfo?(krit)
Flags: needinfo?(cam)
Ehsan filed this too and provided a patch in bug 1208901.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(krit)
Flags: needinfo?(cam)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.