[Webkit-unassigned] [Bug 46713] JSC compile fails on 32bit platform when Regexp Tracing is enabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 29 05:07:11 PDT 2010


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


Csaba Osztrogonac <ossy at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #69036|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #3 from Csaba Osztrogonac <ossy at webkit.org>  2010-09-29 05:07:10 PST ---
(From update of attachment 69036)
View in context: https://bugs.webkit.org/attachment.cgi?id=69036&action=review

%lx expects "unsigned long int", but uintptr_t is
"unsigned long int" on 64 bit and "unsigned int" on 32 bit

sizeof(uintptr_t) == sizeof(unsigned long int) always,
but unfortunately unsigned int != unsigned long int. :(

I propose to cast unsigned long int with reinterpret_cast and use %014lx.
I prefer reinterpret_cast instead of obsolete C style cast



On 64 bit machine:
-------------------
sizeof(int) = 4
sizeof(long int) = 8
sizeof(long long int) = 8
sizeof(uintptr_t) = 8

sizeof(uintptr_t) == sizeof(unsigned long int) == 8
typedef unsigned long int uintptr_t;

On 32 bit machine:
-------------------
sizeof(int) = 4
sizeof(long int) = 4
sizeof(long long int) = 8
sizeof(uintptr_t) = 4

sizeof(uintptr_t) == sizeof(unsigned long int) == 4
typedef unsigned int uintptr_t;

> JavaScriptCore/runtime/RegExp.cpp:257
> -            sprintf(jitAddr, "0x%014lx", (uintptr_t)codeBlock.getAddr());
> +            sprintf(jitAddr, "%16p", codeBlock.getAddr());

sprintf(jitAddr, "0x%014lx", reinterpret_cast<unsigned long int>(codeBlock.getAddr()));

-- 
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