Turn an assert in vmethod interpose code into a mandatory check and abort.

develop
Alexander Gavrilov 2012-08-22 18:22:59 +04:00
parent 7987ea9a98
commit f0fc3acf87
1 changed files with 7 additions and 1 deletions

@ -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), : host(host), vmethod_idx(vmethod_idx), interpose_method(interpose_method), chain_mptr(chain_mptr),
saved_chain(NULL), next(NULL), prev(NULL) 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() VMethodInterposeLinkBase::~VMethodInterposeLinkBase()