mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960591 - Prevent implicitly constructing nsTArray<E> elements from E* pointers - r=ehsan
This commit is contained in:
parent
ed58dd2e28
commit
00e9c80dbb
@ -524,6 +524,11 @@ public:
|
||||
// Invoke the copy-constructor in place.
|
||||
template<class A>
|
||||
static inline void Construct(E *e, const A &arg) {
|
||||
typedef typename mozilla::RemoveCV<E>::Type E_NoCV;
|
||||
typedef typename mozilla::RemoveCV<A>::Type A_NoCV;
|
||||
static_assert(!mozilla::IsSame<E_NoCV*, A_NoCV>::value,
|
||||
"For safety, we disallow constructing nsTArray<E> elements "
|
||||
"from E* pointers. See bug 960591.");
|
||||
new (static_cast<void *>(e)) E(arg);
|
||||
}
|
||||
// Invoke the destructor in place.
|
||||
|
Loading…
Reference in New Issue
Block a user