Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: patches/nspr-no-pointers-in-longs.patch

Issue 757333003: Win64: Fix a pointer truncation bug in nspr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patches/nspr-no-pointers-in-longs.patch
===================================================================
--- patches/nspr-no-pointers-in-longs.patch (revision 0)
+++ patches/nspr-no-pointers-in-longs.patch (working copy)
@@ -0,0 +1,35 @@
+diff --git a/nspr/pr/src/threads/combined/pruthr.c b/nspr/pr/src/threads/combined/pruthr.c
+index 825ed89..4fb8765 100644
+--- a/nspr/pr/src/threads/combined/pruthr.c
++++ b/nspr/pr/src/threads/combined/pruthr.c
+@@ -73,13 +73,13 @@ void _PR_InitThreads(PRThreadType type, PRThreadPriority priority,
+ #ifndef HAVE_CUSTOM_USER_THREADS
+ stack = PR_NEWZAP(PRThreadStack);
+ #ifdef HAVE_STACK_GROWING_UP
+- stack->stackTop = (char*) ((((long)&type) >> _pr_pageShift)
++ stack->stackTop = (char*) ((((intptr_t)&type) >> _pr_pageShift)
+ << _pr_pageShift);
+ #else
+ #if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS)
+ stack->stackTop = (char*) &thread;
+ #else
+- stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1)
++ stack->stackTop = (char*) ((((intptr_t)&type + _pr_pageSize - 1)
+ >> _pr_pageShift) << _pr_pageShift);
+ #endif
+ #endif
+@@ -174,12 +174,12 @@ static void _PR_InitializeNativeStack(PRThreadStack *ts)
+ ** Setup stackTop and stackBottom values.
+ */
+ #ifdef HAVE_STACK_GROWING_UP
+- ts->allocBase = (char*) ((((long)&ts) >> _pr_pageShift)
++ ts->allocBase = (char*) ((((intptr_t)&ts) >> _pr_pageShift)
+ << _pr_pageShift);
+ ts->stackBottom = ts->allocBase + ts->stackSize;
+ ts->stackTop = ts->allocBase;
+ #else
+- ts->allocBase = (char*) ((((long)&ts + _pr_pageSize - 1)
++ ts->allocBase = (char*) ((((intptr_t)&ts + _pr_pageSize - 1)
+ >> _pr_pageShift) << _pr_pageShift);
+ ts->stackTop = ts->allocBase;
+ ts->stackBottom = ts->allocBase - ts->stackSize;
« nspr/pr/src/threads/combined/pruthr.c ('K') | « nspr/pr/src/threads/combined/pruthr.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698