diff --git a/src/pass1.cpp b/src/pass1.cpp index 3c19349..ed7d445 100644 --- a/src/pass1.cpp +++ b/src/pass1.cpp @@ -289,14 +289,20 @@ struct DummyPass4 : public ModulePass { for(unsigned i=2; igetOperand(i); - auto alias = dyn_cast(op->getOperand(0));//dyn_cast(op); - auto someth = op->getOperand(0); - Function *function = NULL; - if(alias) - function = dyn_cast(alias->getOperand(0)); - else - function = dyn_cast(someth); - fprintf(stderr, " %d: %s\n", i-2, function->getName().str().c_str()); + const char *fname = NULL; + if(!dyn_cast(op)) { + Function *function = NULL; + auto alias = dyn_cast(op->getOperand(0));//dyn_cast(op); + auto someth = op->getOperand(0); + auto etc = dyn_cast(someth); + if(alias) + function = dyn_cast(alias->getOperand(0)); + else + function = dyn_cast(someth); + if(function) + fname = function->getName().str().c_str(); + } + fprintf(stderr, " %d: %s\n", i-2, fname); } } diff --git a/test/virtual-methods.cpp b/test/virtual-methods.cpp index 11d5ecb..bb534c7 100644 --- a/test/virtual-methods.cpp +++ b/test/virtual-methods.cpp @@ -19,7 +19,7 @@ class C : public B void other(void); }; -class D : public virtual C +class D : public C { public: virtual void RT method(void) {};