[llvm-dev] Get segfault with ModulePass

Gerion Entrup via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 14 09:50:29 PDT 2017


Am Montag, 12. Juni 2017, 19:31:52 CEST schrieben Sie:
> On 6/11/2017 9:14 AM, Gerion Entrup via llvm-dev wrote:
> > Hi,
> >
> > thanks for the answer.
> >
> > Am Sonntag, 11. Juni 2017, 02:16:36 CEST schrieben Sie:
> >> Have you tried building LLVM with assertions enabled? Assertions are
> >> often a good way to catch API misuses, but they aren't on by default
> >> for release builds.
> > Good advice. You're right. Now an assertion triggers. The problem
> > seems to be the argument iterator.
> >
> > Do you know some way to circumvent this. I've found no way to directly
> > get the ith argument of a function.
> 
> Have you tried dumping the function declaration which crashes 
> ("F->dump()")?  I suspect you're running into a function that doesn't 
> have as many arguments as you expect.
That was it, thank you. The function has varargs and the i points to the
variable argument.

A simple check prevents the error.

Gerion


More information about the llvm-dev mailing list