WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
27843
(V8) Invalid member function pointer hashing in SVG bindings.
https://bugs.webkit.org/show_bug.cgi?id=27843
Summary
(V8) Invalid member function pointer hashing in SVG bindings.
Dean McNamee
Reported
2009-07-30 11:26:21 PDT
There is some code to create and reuse SVG wrappers in the binding code. Previously it hashed a struct with 1 pointer and 2 member function pointers. The problem is member function pointers are opaque, and at least on MSVC cannot be hashed reliably (and it doesn't make sense to try to read the opaque bytes). See
http://www.codeproject.com/KB/cpp/FastDelegate.aspx
for more details on the implementations. There are a few options, all of them involve not trying to hash the member function pointer. One would be to remove member function pointers all together and create thunk wrappers. Another option would be to use something like a std::map, since the compiler should implement operator<, etc correctly. The option I took was to add some more hashing material during the binding generation, so we can hash the pointer and a generated field hash together. It would probably be best to remove the use of member function pointers all together but that is a much bigger task.
Attachments
Patch
(5.48 KB, patch)
2009-07-30 11:31 PDT
,
Dean McNamee
dglazkov
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dean McNamee
Comment 1
2009-07-30 11:31:33 PDT
Created
attachment 33794
[details]
Patch
Dean McNamee
Comment 2
2009-07-30 11:35:04 PDT
(In reply to
comment #0
)
> There is some code to create and reuse SVG wrappers in the binding code. > Previously it hashed a struct with 1 pointer and 2 member function pointers. > The problem is member function pointers are opaque, and at least on MSVC cannot > be hashed reliably (and it doesn't make sense to try to read the opaque bytes). > > See
http://www.codeproject.com/KB/cpp/FastDelegate.aspx
for more details on the > implementations. > > There are a few options, all of them involve not trying to hash the member > function pointer. One would be to remove member function pointers all together > and create thunk wrappers. Another option would be to use something like a > std::map, since the compiler should implement operator<, etc correctly.
(It was just pointed out to me that the compiler only gives you == and != for member function pointers, so std::map is not a possible solution).
> > The option I took was to add some more hashing material during the binding > generation, so we can hash the pointer and a generated field hash together. It > would probably be best to remove the use of member function pointers all > together but that is a much bigger task.
Dimitri Glazkov (Google)
Comment 3
2009-07-30 12:18:28 PDT
Comment on
attachment 33794
[details]
Patch r=me.
Dimitri Glazkov (Google)
Comment 4
2009-07-30 12:32:19 PDT
Landed as
http://trac.webkit.org/changeset/46596
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug