This is an archive of the discontinued LLVM Phabricator instance.

check before accessing possibly null node
AbandonedPublic

Authored by danix800 on Oct 6 2020, 7:33 AM.

Details

Reviewers
anna
saugustine
Summary

Testcase: (main.cpp)

int foo(int i);

int main() {
  int i = 1;
  while (i-- >= 0) {
    return 3 / foo(i);
  }
}

run with

clang -cc1 -analyze -analyzer-checker=debug.DumpDominators main.cpp

triggers nullptr dereference.

Diff Detail

Event Timeline

danix800 created this revision.Oct 6 2020, 7:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2020, 7:33 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
danix800 requested review of this revision.Oct 6 2020, 7:33 AM
danix800 abandoned this revision.Oct 8 2020, 3:31 PM