From d561ff3fa9af1517e289f7eb31e56c233eebecc5 Mon Sep 17 00:00:00 2001 From: fef Date: Mon, 19 Jul 2021 15:20:09 +0200 Subject: [PATCH] nref: put refcount at the end of the test struct --- test/CMakeLists.txt | 1 + test/nref.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9e5f874..b02e38d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,6 +19,7 @@ add_executable(neo_test neo_test.cpp) include(string/string.cmake) target_sources(neo_test PRIVATE + list.cpp nref.cpp ) diff --git a/test/nref.cpp b/test/nref.cpp index 00b9753..20d1475 100644 --- a/test/nref.cpp +++ b/test/nref.cpp @@ -15,8 +15,9 @@ * code rather than the fun quirks C++ is infamous for. */ extern "C" struct nref_test { - NREF_FIELD; bool *called; + /* NREF_FIELD is not at the beginning to ensure offsets are subtracted */ + NREF_FIELD; }; void test_destroy(struct nref_test *ptr)