Bug 1531029 - Fix incorrect `sizeof` expression. r=ehsan
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 28 Feb 2019 11:05:34 +1100
changeset 519759 75dd13876d89896a73a456d92fb0f3de4e3c72dc
parent 519758 a8fafeb134457ed0fd12e2d38dba3fc00eaf6cae
child 519760 c59e07cae80fcf325ff695b5e24e4aa823f034fd
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1531029
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531029 - Fix incorrect `sizeof` expression. r=ehsan This doesn't change behaviour because `sizeof(uintptr_t)` equals `sizeof(uintptr_t*)`, but it's good to make things more obviously correct. Differential Revision: https://phabricator.services.mozilla.com/D21487
memory/replace/dmd/test/SmokeDMD.cpp
--- a/memory/replace/dmd/test/SmokeDMD.cpp
+++ b/memory/replace/dmd/test/SmokeDMD.cpp
@@ -310,17 +310,17 @@ void TestPartial(const char* aTestName, 
   Analyze(std::move(f));
 }
 
 void TestScan(int aSeven) {
   auto f = MakeUnique<FpWriteFunc>("basic-scan.json");
 
   ResetEverything("--mode=scan");
 
-  uintptr_t* p = (uintptr_t*)malloc(6 * sizeof(uintptr_t*));
+  uintptr_t* p = (uintptr_t*)malloc(6 * sizeof(uintptr_t));
   UseItOrLoseIt(p, aSeven);
 
   // Hard-coded values checked by scan-test.py
   p[0] = 0x123;                         // outside a block, small value
   p[1] = 0x0;                           // null
   p[2] = (uintptr_t)((uint8_t*)p - 1);  // pointer outside a block, but nearby
   p[3] = (uintptr_t)p;                  // pointer to start of a block
   p[4] = (uintptr_t)((uint8_t*)p + 1);  // pointer into a block