Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53e56177 authored by Colin Cross's avatar Colin Cross Committed by android-build-merger
Browse files

Merge "Fix stack test on arm32"

am: 7ff1eb69

Change-Id: Iea0a2a0e6f4658ec9b550216fc43f208f78122ae
parents 771be4c2 7ff1eb69
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ class HiddenPointer {
  volatile uintptr_t ptr_;
};

static void Ref(void* ptr) {
// Trick the compiler into thinking a value on the stack is still referenced.
static void Ref(void** ptr) {
  write(0, ptr, 0);
}

@@ -58,14 +59,14 @@ TEST(MemunreachableTest, stack) {

  {
    void* ptr = hidden_ptr.Get();
    Ref(ptr);
    Ref(&ptr);

    UnreachableMemoryInfo info;

    ASSERT_TRUE(GetUnreachableMemory(info));
    ASSERT_EQ(0U, info.leaks.size());

    Ref(ptr);
    ptr = nullptr;
  }

  {