From 54d4b68f3cdef054b55849a248a8bcdaac8033df Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sat, 18 Apr 2020 20:39:57 -0500 Subject: [PATCH] don't crash if the path to an instance-vector contains a null pointer --- library/DataStatics.cpp | 5 +++-- library/xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/library/DataStatics.cpp b/library/DataStatics.cpp index 61b7b6378..275cae584 100644 --- a/library/DataStatics.cpp +++ b/library/DataStatics.cpp @@ -12,10 +12,11 @@ namespace { template - inline T &_toref(T &r) { return r; } + inline T *_toptr(T &r) { return &r; } template - 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 \ DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \ diff --git a/library/xml b/library/xml index 816497911..d9a31fa45 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 81649791116754a789aae85222797c4df3945b08 +Subproject commit d9a31fa45228a7507b975dbbddbf00c7905644ea