diff options
| author | Alexander Gavrilov | 2012-08-22 18:22:59 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-08-22 18:22:59 +0400 |
| commit | f0fc3acf8719f9b135c194e04b147bd4e068d7e4 (patch) | |
| tree | 3e466ecaab81d7db6df662099737a38cc1fcbac5 /library | |
| parent | 7987ea9a9877a4e9f44492210784c7e8d7f94bb9 (diff) | |
| download | dfhack-f0fc3acf8719f9b135c194e04b147bd4e068d7e4.tar.gz dfhack-f0fc3acf8719f9b135c194e04b147bd4e068d7e4.tar.bz2 dfhack-f0fc3acf8719f9b135c194e04b147bd4e068d7e4.tar.xz | |
Turn an assert in vmethod interpose code into a mandatory check and abort.
Diffstat (limited to 'library')
| -rw-r--r-- | library/VTableInterpose.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/VTableInterpose.cpp b/library/VTableInterpose.cpp index ad46b0b0..3725ccba 100644 --- a/library/VTableInterpose.cpp +++ b/library/VTableInterpose.cpp @@ -164,7 +164,13 @@ 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); + if (vmethod_idx < 0 || interpose_method == NULL) + { + fprintf(stderr, "Bad VMethodInterposeLinkBase arguments: %d %08x\n", + vmethod_idx, unsigned(interpose_method)); + fflush(stderr); + abort(); + } } VMethodInterposeLinkBase::~VMethodInterposeLinkBase() |
