mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
fixed GH #2106: Undefined behavior in Delegate::equals()
This commit is contained in:
parent
d73bb2ea86
commit
0d3c3ce4d4
@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
bool equals(const AbstractDelegate<TArgs>& other) const
|
bool equals(const AbstractDelegate<TArgs>& other) const
|
||||||
{
|
{
|
||||||
const Delegate* pOtherDelegate = reinterpret_cast<const Delegate*>(other.unwrap());
|
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
|
||||||
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ public:
|
|||||||
|
|
||||||
bool equals(const AbstractDelegate<TArgs>& other) const
|
bool equals(const AbstractDelegate<TArgs>& other) const
|
||||||
{
|
{
|
||||||
const Delegate* pOtherDelegate = reinterpret_cast<const Delegate*>(other.unwrap());
|
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
|
||||||
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ public:
|
|||||||
|
|
||||||
bool equals(const AbstractDelegate<void>& other) const
|
bool equals(const AbstractDelegate<void>& other) const
|
||||||
{
|
{
|
||||||
const Delegate* pOtherDelegate = reinterpret_cast<const Delegate*>(other.unwrap());
|
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
|
||||||
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ public:
|
|||||||
|
|
||||||
bool equals(const AbstractDelegate<void>& other) const
|
bool equals(const AbstractDelegate<void>& other) const
|
||||||
{
|
{
|
||||||
const Delegate* pOtherDelegate = reinterpret_cast<const Delegate*>(other.unwrap());
|
const Delegate* pOtherDelegate = dynamic_cast<const Delegate*>(other.unwrap());
|
||||||
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
return pOtherDelegate && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user