Closed Bug 603317 Opened 14 years ago Closed 14 years ago

unreachable default case in TIntermediate::addConversion

Categories

(Core :: Graphics, defect)

defect
Not set
trivial

Tracking

()

RESOLVED INVALID

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file)

322 TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node)
323 {

353     TBasicType promoteTo;
355     switch (op) {
359         case EOpConstructBool:
360             promoteTo = EbtBool;
361             break;
362         case EOpConstructFloat:
363             promoteTo = EbtFloat;
364             break;
365         case EOpConstructInt:
366             promoteTo = EbtInt;
367             break;
368         default:
372             if (type.getBasicType() != node->getType().getBasicType())
373                 return 0;
378             return node;
379     }

381     if (node->getAsConstantUnion()) {
383         return (promoteConstantUnion(promoteTo, node->getAsConstantUnion()));
384     } else {

392         switch (promoteTo) {
393             case EbtFloat:
401                 break;
402             case EbtBool:
410                 break;
411             case EbtInt:
419                 break;
420             default:

coverity correctly insists that this case isn't reachable:
421                 infoSink.info.message(EPrefixInternalError, "Bad promotion type", node->getLine());
422                 return 0;
423         }

I know you're trying to be defensive, but Coverity is willing to find this of bug for you and thus requests that you not include such a case.
Attached patch remove unreachable code (deleted) — Splinter Review
Assignee: nobody → timeless
This is upstream ANGLE code; don't want to patch this in our tree, needs to go upstream.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: