Use a more type safe hash table in nsNSSShutDown.{h,cpp} to avoid casts

NEW
Unassigned

Status

()

Core
Security: PSM
P5
normal
2 years ago
2 months ago

People

(Reporter: Cykesiopka, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [psm-cleanup], URL)

(Reporter)

Description

2 years ago
(David Keeler [:keeler] (use needinfo?) from Bug 1271501 comment #8)
> ::: security/manager/ssl/nsNSSShutDown.cpp:119
> (Diff revision 1)
> >    for (auto iter = singleton->mPK11LogoutCancelObjects.Iter();
> >         !iter.Done();
> >         iter.Next()) {
> >      auto entry = static_cast<ObjectHashEntry*>(iter.Get());
> > -    nsOnPK11LogoutCancelObject *pklco =
> > -      reinterpret_cast<nsOnPK11LogoutCancelObject*>(entry->obj);
> > +    nsOnPK11LogoutCancelObject* pklco =
> > +      BitwiseCast<nsOnPK11LogoutCancelObject*, nsNSSShutDownObject*>(entry->obj);
> 
> This actually seems like a bad situation we should fix (in a follow-up). I'm
> sure we can use a higher-level hash table that's parameterized or something.

Indeed. It looks like one of the hash table classes under xpcom/glue/ will work.
We can probably just wontfix this when we remove the shutdown machinery altogether.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.