diff options
author | Matthew Bentham <matthew.bentham@arm.com> | 2021-06-30 12:00:05 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2021-07-01 15:56:11 +0000 |
commit | f2f108254546136b476af5dcfe77fa8120adc5bc (patch) | |
tree | f9d944ef67ff95481b8d7a7ee5cb5681bdb4d716 /src/backends/backendsCommon/test | |
parent | 3ab85485968c0e70d0378de3243119fb7b2f7e94 (diff) | |
download | armnn-f2f108254546136b476af5dcfe77fa8120adc5bc.tar.gz |
Fix undefined behaviour in PolymorphicDowncast
In the assertion part of PolymorphicDowncast (and PolymorphicPointerDowncast)
there was an unnecessary static_cast of the source pointer to the destination
type. This is unnecessary because the implicit conversion of the result pointer
back to the base type is sufficient to check for correctness of the downcast,
and potentially harmful because if the downcast is actually incorrect the
behaviour of static_cast is undefined (not actually known to be a problem
in any tested implementation).
Fixes warnings detected by ubsan.
Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
Change-Id: I9126288cbb06564009f94e57f6ca4688fc3b53c4
Diffstat (limited to 'src/backends/backendsCommon/test')
0 files changed, 0 insertions, 0 deletions