From 39ce79907c2a18cbae025f40c8e726cc1dd1a545 Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Mon, 3 Oct 2011 10:28:50 -0700 Subject: [PATCH] Bug 691143: Avoid negation of unsigned. (r=luke) --- js/src/ds/LifoAlloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index ddab0aef85a2..48a2cad68bf2 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -65,7 +65,7 @@ AlignPtr(void *orig) tl::FloorLog2::result == tl::CeilingLog2::result >::result _; - char *result = (char *) ((uintptr_t(orig) + (LIFO_ALLOC_ALIGN - 1)) & -LIFO_ALLOC_ALIGN); + char *result = (char *) ((uintptr_t(orig) + (LIFO_ALLOC_ALIGN - 1)) & (~LIFO_ALLOC_ALIGN + 1)); JS_ASSERT(uintptr_t(result) % LIFO_ALLOC_ALIGN == 0); return result; }