Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

Attachments (1)

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

Download all attachments as: .zip

Change History (6)

comment:1 by noryb009, 10 years ago

patch: 01

comment:2 by anevilyak, 10 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, 10 years ago

Shouldn't it be changed to use `static_cast' instead, then?

Version 0, edited 10 years ago by noryb009 (next)

comment:4 by anevilyak, 10 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, 10 years ago

Ok, thank you for the explanation!

Note: See TracTickets for help on using tickets.