summaryrefslogtreecommitdiff
path: root/library/VTableInterpose.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-18 11:48:07 +0400
committerAlexander Gavrilov2012-08-18 11:48:07 +0400
commit01ba2a31fc2dd7597ab6e2db3f1496b123e10720 (patch)
tree60de15f2bd50bca0bb9e68f82dc77c1d85014934 /library/VTableInterpose.cpp
parent236ffd578b66805fa45d65df79e099d00156bfff (diff)
downloaddfhack-01ba2a31fc2dd7597ab6e2db3f1496b123e10720.tar.gz
dfhack-01ba2a31fc2dd7597ab6e2db3f1496b123e10720.tar.bz2
dfhack-01ba2a31fc2dd7597ab6e2db3f1496b123e10720.tar.xz
Tweak the interpose API, and fix a couple of bugs.
Diffstat (limited to 'library/VTableInterpose.cpp')
-rw-r--r--library/VTableInterpose.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/VTableInterpose.cpp b/library/VTableInterpose.cpp
index 44707062..f612ba8b 100644
--- a/library/VTableInterpose.cpp
+++ b/library/VTableInterpose.cpp
@@ -161,6 +161,7 @@ VMethodInterposeLinkBase::VMethodInterposeLinkBase(virtual_identity *host, int v
: host(host), vmethod_idx(vmethod_idx), interpose_method(interpose_method), chain_mptr(chain_mptr),
saved_chain(NULL), next(NULL), prev(NULL)
{
+ assert(vmethod_idx >= 0 && interpose_method != NULL);
}
VMethodInterposeLinkBase::~VMethodInterposeLinkBase()
@@ -198,6 +199,7 @@ bool VMethodInterposeLinkBase::apply()
return false;
set_chain(old_ptr);
+ host->interpose_list.push_back(this);
// Link into the chain if any
if (old_link)