[Webkit-unassigned] [Bug 33057] REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 6 19:48:41 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33057


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aroben at apple.com,
                   |                            |sfalken at apple.com




--- Comment #6 from Alexey Proskuryakov <ap at webkit.org>  2010-01-06 19:48:38 PST ---
The problem is due to the fact that jsString() and related functions are now
inline, so JSString objects constructed from WebCore get a different virtual
function table pointer. This breaks isJSString() function. I have added
appropriate assertions to constructors, and saw them fire:

ASSERT(vptr() == globalData->jsStringVPtr);

The common way of telling the compiler to use the same vtable in DLL and EXE is
to use __declspec(dllimport/dllexport). And this fixes the assertion indeed
(that's equivalent to what we have on Mac OS X). But it doesn't fix the actual
bug!

Turns out that MSVC changes the vptr AFTER constructor exits, trying to fix
bugs in certain kinds of code for programmers:
<http://groups.google.com/group/microsoft.public.vc.language/msg/55cdcefeaf770212>.
I couldn't find a way to disable this behavior. Some possible ways to fix this
are:
- don't construct inline (or only do that when building JSC);
- fix vptr in jsString() after constructing the object;
- check for type in some other way (maybe typeid().name, like dynamic_cast
does? I'm not sure if that works without RTTI though, or if MSVC breaks
typename identity across DLL boundaries, too).

Suggestions are welcome.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list