Skip to content

Commit

Permalink
dg/llvm/pta/SVFPointerAnalysis.h: fix incompatibility with latest SVF
Browse files Browse the repository at this point in the history
If `buildSymbolTableInfo` is not called on the built `SVFModule`,
`PAGBuilder` tries to dereference a `nullptr` which results in
a segmentation violation.

Related UBSAN report:
SVF/lib/SVF-FE/ICFGBuilder.cpp:43:59: runtime error: member call on null pointer of type 'struct SVFModule'
    0 0x55ce7156a1b0 in SVF::ICFGBuilder::build(SVF::SVFModule*) SVF/lib/SVF-FE/ICFGBuilder.cpp:43
    1 0x55ce7136cbe5 in SVF::PAG::PAG(bool) SVF/lib/Graphs/PAG.cpp:367
    2 0x55ce7120a576 in SVF::PAG::getPAG(bool) (dg/build/tools/llvm-slicer+0xc73576)
    3 0x55ce7120a9d6 in SVF::PAGBuilder::PAGBuilder() (dg/build/tools/llvm-slicer+0xc739d6)
    4 0x55ce7120f6d8 in dg::SVFPointerAnalysis::run() (dg/build/tools/llvm-slicer+0xc786d8)
    5 0x55ce7120ffab in dg::llvmdg::LLVMDependenceGraphBuilder::_runPointerAnalysis() (dg/build/tools/llvm-slicer+0xc78fab)
    6 0x55ce71213d56 in dg::llvmdg::LLVMDependenceGraphBuilder::constructCFGOnly() (dg/build/tools/llvm-slicer+0xc7cd56)
    7 0x55ce712273ad in Slicer::buildDG(bool) (dg/build/tools/llvm-slicer+0xc903ad)
    8 0x55ce711d5ef4 in main dg/tools/llvm-slicer.cpp:248
  • Loading branch information
lzaoral committed Oct 20, 2021
1 parent 5d01526 commit 4f21761
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/dg/llvm/PointerAnalysis/SVFPointerAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ class SVFPointerAnalysis : public LLVMPointerAnalysis {
moduleset->buildSVFModule(*const_cast<llvm::Module *>(_module));
assert(_svfModule && "Failed building SVF module");

_svfModule->buildSymbolTableInfo();

PAGBuilder builder;
PAG *pag = builder.build(_svfModule);

Expand Down

0 comments on commit 4f21761

Please sign in to comment.