[haiku-commits] haiku: hrev46155 - in src: build/libroot kits/support

  • From: pdziepak@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 1 Oct 2013 15:17:07 +0200 (CEST)

hrev46155 adds 1 changeset to branch 'master'
old head: d46d383800c424cd7dc656a4ad9411c198e79393
new head: 1238bebddc4939d2dc0741c9bdc625a1ce85c1ff
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=1238beb+%5Ed46d383

----------------------------------------------------------------------------

1238beb: build: Add stub _get_thread_info() needed by support/Referenceable.cpp
  
  This is a step towards fixing #10042.
  
  When DEBUG is set BReferenceable::~BReferenceable() performs some checks
  ensuring that the object is destroyed correctly. These checks require
  information on thread stack, which is obtained by get_thread_info().
  
  _get_thread_info() stub is added (actually, readded) which always returns
  B_ERROR. Moreover, the check in BReferenceable destructor is modified
  so that it does not fail when get_thread_info() fails.

                                    [ Pawel Dziepak <pdziepak@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46155
Commit:      1238bebddc4939d2dc0741c9bdc625a1ce85c1ff
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1238beb
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Tue Oct  1 13:06:17 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/10042

----------------------------------------------------------------------------

2 files changed, 7 insertions(+), 7 deletions(-)
src/build/libroot/thread.cpp       | 10 +++++-----
src/kits/support/Referenceable.cpp |  4 ++--

----------------------------------------------------------------------------

diff --git a/src/build/libroot/thread.cpp b/src/build/libroot/thread.cpp
index 7998694..b359027 100644
--- a/src/build/libroot/thread.cpp
+++ b/src/build/libroot/thread.cpp
@@ -38,11 +38,11 @@ find_thread(const char *name)
 }
 
 // _get_thread_info
-// status_t
-// _get_thread_info(thread_id id, thread_info *info, size_t size)
-// {
-//     return B_ERROR;
-// }
+status_t
+_get_thread_info(thread_id id, thread_info* info, size_t size)
+{
+       return B_ERROR;
+}
 
 // _get_next_thread_info
 // status_t
diff --git a/src/kits/support/Referenceable.cpp 
b/src/kits/support/Referenceable.cpp
index ca849f8..fcc981c 100644
--- a/src/kits/support/Referenceable.cpp
+++ b/src/kits/support/Referenceable.cpp
@@ -47,8 +47,8 @@ BReferenceable::~BReferenceable()
                        // stack range to be sure.
                        thread_info info;
                        status_t result = get_thread_info(find_thread(NULL), 
&info);
-                       if (result != B_OK || this < info.stack_base
-                               || this > info.stack_end) {
+                       if (result == B_OK &&  (this < info.stack_base
+                                       || this > info.stack_end)) {
                                snprintf(message, sizeof(message), "Deleted 
referenceable "
                                        "object that's not on the stack (this: 
%p, stack_base: %p,"
                                        " stack_end: %p)\n", this, 
info.stack_base,


Other related posts:

  • » [haiku-commits] haiku: hrev46155 - in src: build/libroot kits/support - pdziepak