)]}'
{
  "commit": "4fca7b05e397e381466d6943a56f8407349c7594",
  "tree": "16f2cd521355302102274b04f7fc2151cdc848ab",
  "parents": [
    "d36e2b621fd9e3354cef00135ad0cb8923ae4269"
  ],
  "author": {
    "name": "Kashika Akhouri",
    "email": "akhourik@google.com",
    "time": "Fri Nov 21 18:51:21 2025 +0530"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Nov 21 18:51:21 2025 +0530"
  },
  "message": "[LifetimeSafety] Detect expiry of loans to trivially destructed types (#168855)\n\nHandling Trivially Destructed Types\n\nThis PR uses `AddLifetime` to handle expiry of loans to trivially\ndestructed types.\n\nExample:\n```cpp\nint * trivial_uar(){\n    int *ptr;\n    int x \u003d 1;\n    ptr \u003d \u0026x;\n    return ptr;\n}\n```\n\nThe CFG created now has an Expire Fact for trivially destructed types:\n```\nFunction: trivial_uar\n  Block B2:\n  End of Block\n  Block B1:\n    Issue (0 (Path: x), ToOrigin: 0 (Expr: DeclRefExpr))\n    OriginFlow (Dest: 1 (Expr: UnaryOperator), Src: 0 (Expr: DeclRefExpr))\n    Use (2 (Decl: ptr), Write)\n    OriginFlow (Dest: 2 (Decl: ptr), Src: 1 (Expr: UnaryOperator))\n    Use (2 (Decl: ptr), Read)\n    OriginFlow (Dest: 3 (Expr: ImplicitCastExpr), Src: 2 (Decl: ptr))\n    Expire (0 (Path: x))\n    OriginEscapes (3 (Expr: ImplicitCastExpr))\n  End of Block\n  Block B0:\n  End of Block\n```\n\nThis Expire Fact issues UAR and UAF warnings.\n\nFixes https://github.com/llvm/llvm-project/issues/162862",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8ea37259c570baa0b90ee7dddd91926f9b5db498",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h",
      "new_id": "878cb90b685f9d321935a9e3ce435f0fad23594e",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h"
    },
    {
      "type": "modify",
      "old_id": "cb9a202b089682610644a3e78af12dff9fdeb593",
      "old_mode": 33188,
      "old_path": "clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp",
      "new_id": "f7be472ed15b51b8b289f0b0756264a42428a377",
      "new_mode": 33188,
      "new_path": "clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp"
    },
    {
      "type": "modify",
      "old_id": "0fa75a24db4f35310c0f0ac2bbb9540a35c96912",
      "old_mode": 33188,
      "old_path": "clang/lib/Sema/AnalysisBasedWarnings.cpp",
      "new_id": "43d2b9a829545463ae1b1498c3e211e061dc549e",
      "new_mode": 33188,
      "new_path": "clang/lib/Sema/AnalysisBasedWarnings.cpp"
    },
    {
      "type": "modify",
      "old_id": "11d3b836db3e751c0fcf0ff363f6d10afb8e8c37",
      "old_mode": 33188,
      "old_path": "clang/test/Sema/warn-lifetime-safety-dataflow.cpp",
      "new_id": "7b6fc9201af6df68a3a98667bb6865aee1d02375",
      "new_mode": 33188,
      "new_path": "clang/test/Sema/warn-lifetime-safety-dataflow.cpp"
    },
    {
      "type": "modify",
      "old_id": "2803e73b5aee27b962d26ac9efb09fec3dd7c004",
      "old_mode": 33188,
      "old_path": "clang/test/Sema/warn-lifetime-safety.cpp",
      "new_id": "e80a05860389cdfd2d160a57a0b88dbc048f63fd",
      "new_mode": 33188,
      "new_path": "clang/test/Sema/warn-lifetime-safety.cpp"
    },
    {
      "type": "modify",
      "old_id": "558a22af72572397cb8d05f45157ae7c0fe4a105",
      "old_mode": 33188,
      "old_path": "clang/unittests/Analysis/LifetimeSafetyTest.cpp",
      "new_id": "a895475013c985d8c114c3cb1095c378940f533d",
      "new_mode": 33188,
      "new_path": "clang/unittests/Analysis/LifetimeSafetyTest.cpp"
    }
  ]
}
