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

            Bug ID: 27453
           Summary: [ASan] Implement use-after-scope check.
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: vitalyb...@google.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Some local variables can have lifetime smaller then function execution.
E.g.:

int main() {
  int *p = nullptr;
  {
    int x = 0;
    p = &x;
  }
  return *p; 
}

Usually such cases does not crash, as stack frame still has region allocated
for such variables. Still content of such variables after lifetime end is
undefined.

Asan is can detect such cases by poisoning/poisoning memory according lifetime
markers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to