Bug 16922 - _NPN_GetIntIdentifier does not work for values 0 or -1 due to using HashMap
Summary: _NPN_GetIntIdentifier does not work for values 0 or -1 due to using HashMap
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-18 04:14 PST by John Ripley
Modified: 2008-01-18 06:14 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Ripley 2008-01-18 04:14:28 PST
The implementation of HashMap for integer keys uses values 0 and -1 as special empty and deleted bins. However, a plug-in can call NPN_GetIntIdentifier for integers 0 or -1.

I'm currently working around this by remapping the incoming int32 space to uint64 with bit 32 set, which messily avoids 0 or -1.

This causes any plug-in which tries to get an NPIdentifier from Javascript to fail an assertion check.
Comment 1 Mark Rowe (bdash) 2008-01-18 04:37:06 PST
Which revision are you seeing this problem in?  The problem you describe sounds like one which was fixed with <http://trac.webkit.org/projects/webkit/changeset/28366>.
Comment 2 John Ripley 2008-01-18 05:59:53 PST
Sorry - somehow I missed that. The tree I'm working off is mostly 523.x and doesn't have this fix. The trunk version of npruntime.cpp can be taken in isolation, so I'll just grab that.
Comment 3 Mark Rowe (bdash) 2008-01-18 06:14:11 PST
Closing as WFM as this is fixed in HEAD.