[cfe-dev] segmentation fault while building dominator tree in clang

Abu Naser Masud via cfe-dev cfe-dev at lists.llvm.org
Sat Apr 6 06:57:09 PDT 2019


This is my first post in this list. I am building an analysis tool in
ClangTool.I am getting segmentation fault while building a dominator tree
in clang. The sample code that I am using to build the dominator tree is
the following:

*const* Decl* D=*static_cast*<Decl *>(f);     // FunctionDecl f

AnalysisDeclContextManager  *analDeclCtxMgr=*new *AnalysisDeclContextManager

*if*(AnalysisDeclContext  *analDeclCtx=analDeclCtxMgr->getContext(D)){

   DominatorTree domTree;



The input function for my tool is the following code from perlbench(CPU

*static* *bool*

S_adjust_index(pTHX_ AV *av, *const* MAGIC *mg, SSize_t *keyp)


    *bool* adjust_index = 1;

    *if* (mg) {

*/* Handle negative array indices 20020222 MJD */*

SV * *const* ref = SvTIED_obj(MUTABLE_SV(av), mg);


*if* (SvROK(ref) && SvOBJECT(SvRV(ref))) {

    SV * *const* * *const* negative_indices_glob =

hv_fetchs(SvSTASH(SvRV(ref)), NEGATIVE_INDICES_VAR, 0);

    *if* (negative_indices_glob && isGV(*negative_indices_glob)

    && SvTRUE(GvSV(*negative_indices_glob)))

adjust_index = 0;



    *if* (adjust_index) {

*keyp += AvFILL(av) + 1;

*if* (*keyp < 0)

    *return* *FALSE*;


    *return* *TRUE*;


Would you please let me know where the problem is?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190406/fccf6fea/attachment.html>

More information about the cfe-dev mailing list