Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10381 closed bug (invalid)

Fix coverity CID 611220: unchecked dynamic_cast

Reported by: noryb009 Owned by: anevilyak
Priority: normal Milestone: R1
Component: Applications/Debugger Version: R1/Development
Keywords: gci2013 Cc:
Blocked By: Blocking:
Platform: All


Attachments (1)

0001-Fix-coverity-CID-611220-unchecked-dynamic_cast.patch (1022 bytes ) - added by noryb009 6 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by noryb009, 6 years ago

patch: 01

comment:2 by anevilyak, 6 years ago

Resolution: invalid
Status: newclosed

This is a case where Coverity is technically correct, but not practically. The check for TYPE_ENUMERATION already accomplishes the same thing.

comment:3 by noryb009, 6 years ago

Shouldn't the original line be changed to use `static_cast' instead, then?

Last edited 6 years ago by noryb009 (previous) (diff)

comment:4 by anevilyak, 6 years ago

Not necessarily, bear in mind dynamic_cast isn't only for checking type validity ; depending on the structure of the classes in question and the inheritance hierarchy involved, it may also adjust the 'this' pointer in the process, so it's not interchangeable with static_cast except in simple cases.

comment:5 by noryb009, 6 years ago

Ok, thank you for the explanation!

Note: See TracTickets for help on using tickets.