Bug 16922
| Summary: | _NPN_GetIntIdentifier does not work for values 0 or -1 due to using HashMap | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | John Ripley <john.ripley> |
| Component: | Plug-ins | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | mrowe |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Other | ||
| OS: | Other | ||
John Ripley
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
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>.
John Ripley
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.
Mark Rowe (bdash)
Closing as WFM as this is fixed in HEAD.