[llvm-bugs] [Bug 27933] New: engine not emit location check callback where it should

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 30 01:04:57 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27933

            Bug ID: 27933
           Summary: engine not emit location check callback where it
                    should
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: humeafo at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I'm writing a plugin that do location check as in ArrayBoundCheck plugin, but
in some cases the callback is not called:

checkLocation(SVal location, bool isLoad, const Stmt* LoadS, CheckerContext
&checkerContext) const

for the folling test, it's ok
void test(int a, int b) {
  if (a > 10 && b > 10)
  {
      char x[10];
      int z = a+1+b;
      x[z] = 5; // expected-warning{{out-of-bound}}
  }
}

but for the second test no callback is emitted, I think this is obviously a
bug:

void test(int a, int b) {
  if (a > 10 && b > 10)
  {
      char x[10];
      x[a+1+b] = 5; // expected-warning{{out-of-bound}}
  }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160530/69d0f946/attachment.html>


More information about the llvm-bugs mailing list