don't crash if the path to an instance-vector contains a null pointer

develop
Ben Lubar 2020-04-18 20:39:57 -05:00
parent c8ff8d0d8e
commit 54d4b68f3c
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
2 changed files with 4 additions and 3 deletions

@ -12,10 +12,11 @@
namespace { namespace {
template<class T> template<class T>
inline T &_toref(T &r) { return r; } inline T *_toptr(T &r) { return &r; }
template<class T> template<class T>
inline T &_toref(T *&p) { return *p; } inline T *_toptr(T *&p) { return p; }
} }
#define _fieldptr(ptr, fn) (ptr) ? _toptr((ptr)->fn) : NULL
#define INIT_GLOBAL_FUNCTION_PREFIX \ #define INIT_GLOBAL_FUNCTION_PREFIX \
DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \ DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \

@ -1 +1 @@
Subproject commit 81649791116754a789aae85222797c4df3945b08 Subproject commit d9a31fa45228a7507b975dbbddbf00c7905644ea