)]}'
{
  "commit": "e665cf397686e881cfb0728d896d2f375c0aead5",
  "tree": "8ba0eaa010aa408c9ec4160952984b8a17c20284",
  "parents": [
    "dc8596d5485a52abee2967cec72f81ef4872270c"
  ],
  "author": {
    "name": "Maksim Panchenko",
    "email": "maks@fb.com",
    "time": "Mon Aug 25 17:13:30 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Aug 25 17:13:30 2025 -0700"
  },
  "message": "[BOLT] Fix handling of ambiguous jump table entries (#155291)\n\nJump tables may contain entries that point immediately past the end of\ntheir parent function. Normally, such entries are generated by the\ncompiler as a result of builtin_unreachable() case. We used to replace\nthose entries with a label belonging to their parent function assuming\nthe destination doesn\u0027t matter if it\u0027s an undefined behavior.\n\nHowever, if such entry is at the end of the jump table, it could be a\nreal function pointer, not a jump table entry. We rely on heuristics to\ndetect such cases and can drop the trailing function pointer entries\nfrom the table.\n\nThe problem presents when the \"unreachable\" ambiguous entry is followed\nby another ambiguous entry corresponding to the start of the parent\nfunction. In this case we accept pointers as entries and may incorrectly\nupdate the function pointer.\n\nThe solution is to keep ambiguous \"unreachable\" jump table entries\nidentical to the original input, i.e. point to the same function. This\nchange does not affect CFG, but results in the entries being updated\nwith the new function address if it gets relocated.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "311d5c15b8dca14fc70a4d01fd0838d8bdee6f61",
      "old_mode": 33188,
      "old_path": "bolt/lib/Core/BinaryBasicBlock.cpp",
      "new_id": "eeab1ed4d7cffd894e1d9f24cc47dd5cc9b63b9c",
      "new_mode": 33188,
      "new_path": "bolt/lib/Core/BinaryBasicBlock.cpp"
    },
    {
      "type": "modify",
      "old_id": "8f494f105fbba53e8abf080e7125a2544de3ff4c",
      "old_mode": 33188,
      "old_path": "bolt/lib/Core/BinaryFunction.cpp",
      "new_id": "c5c3247e01d04c2c3f2a6af17afc7c4677768617",
      "new_mode": 33188,
      "new_path": "bolt/lib/Core/BinaryFunction.cpp"
    },
    {
      "type": "modify",
      "old_id": "2b5a591f4c7a22faf2e35dfeffb1c7e6fff08950",
      "old_mode": 33188,
      "old_path": "bolt/lib/Passes/IndirectCallPromotion.cpp",
      "new_id": "8a01cb974c5dae0ca20569d8c74980975f7cc05e",
      "new_mode": 33188,
      "new_path": "bolt/lib/Passes/IndirectCallPromotion.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "eb87b9604faf4ce3206074c9cf614b9090bdb8ae",
      "new_mode": 33188,
      "new_path": "bolt/test/X86/jump-table-ambiguous-unreachable.s"
    }
  ]
}
