diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-07-03 08:23:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-07-03 08:24:09 +0200 |
commit | 7bbaa39102367a42ba416db6a578718fc4e7bdf1 (patch) | |
tree | 84f96b45cd377bfb0f5101af23de39eaea8c80f6 /include/rtl/ref.hxx | |
parent | f36e64d8cc4a2fce8d84ef464a482445a8b8540a (diff) |
Catch invalid null pointer operations early
Change-Id: I324d5a6e84e0d2121d8e4612e074b44ed5127b11
Diffstat (limited to 'include/rtl/ref.hxx')
-rw-r--r-- | include/rtl/ref.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx index cccbc0105ff6..3e90ed2b4707 100644 --- a/include/rtl/ref.hxx +++ b/include/rtl/ref.hxx @@ -20,8 +20,11 @@ #ifndef INCLUDED_RTL_REF_HXX #define INCLUDED_RTL_REF_HXX +#include <sal/config.h> + +#include <cassert> + #include <sal/types.h> -#include <osl/diagnose.h> #include <osl/interlck.h> namespace rtl @@ -160,7 +163,7 @@ public: */ inline reference_type * SAL_CALL operator->() const { - OSL_PRECOND(m_pBody, "Reference::operator->() : null body"); + assert(m_pBody != 0); return m_pBody; } @@ -169,7 +172,7 @@ public: */ inline reference_type & SAL_CALL operator*() const { - OSL_PRECOND(m_pBody, "Reference::operator*() : null body"); + assert(m_pBody != 0); return *m_pBody; } |