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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to