)]}'
{
  "commit": "05cc7a2eff688a0d9d27c22dd1589abab5ee2f47",
  "tree": "09cab2cb0730b2bd1bf0d47bc4b1e5a8d38286fe",
  "parents": [
    "8a12183c3bf2fc39a5c6c32307b81d947bc37e22"
  ],
  "author": {
    "name": "Tulgaaaaaaaa",
    "email": "68711572+Tulgaaaaaaaa@users.noreply.github.com",
    "time": "Thu Apr 02 18:14:27 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Apr 02 10:14:27 2026 +0000"
  },
  "message": "fix: correct operator precedence in ForAllFields reverse iteration (#8991)\n\n* fix: correct operator precedence in ForAllFields reverse iteration\n\nThe expression `size() - i + 1` evaluates as `(size() - i) + 1` due to\nleft-to-right associativity, producing an out-of-bounds index when\nreverse\u003dtrue. For a vector of size N, the first iteration (i\u003d0) accesses\nindex N+1, which is 2 past the last valid index.\n\nChanged to `size() - (i + 1)` to match the correct implementation\nalready present in bfbs_gen.h:192.\n\nBug: CWE-125 (Out-of-bounds Read), CWE-783 (Operator Precedence Error)\n\n* test: add ForAllFieldsReverseTest for reverse iteration correctness\n\nVerify that ForAllFields with reverse\u003dtrue iterates fields in\ndescending ID order. Tests both Stat (3 fields) and Monster\n(many fields with non-sequential definition order) tables.\n\n---------\n\nCo-authored-by: Tulgaa \u003ctulgaa.kek@gmail.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e77d21b04b909a57c329a421fc848cfc43ade9e1",
      "old_mode": 33188,
      "old_path": "src/reflection.cpp",
      "new_id": "268d7d8515e9fd3d5824b14cb432f606e1567688",
      "new_mode": 33188,
      "new_path": "src/reflection.cpp"
    },
    {
      "type": "modify",
      "old_id": "1c489185204e9282d2427923fbe7f6700956164a",
      "old_mode": 33188,
      "old_path": "tests/reflection_test.cpp",
      "new_id": "9f80b936ce7649dff8d0faae713691ff0081d202",
      "new_mode": 33188,
      "new_path": "tests/reflection_test.cpp"
    },
    {
      "type": "modify",
      "old_id": "fa6f470c6973a70844ab0405b5e8ed9b9b404b5f",
      "old_mode": 33188,
      "old_path": "tests/reflection_test.h",
      "new_id": "da6fb1ff692989f9cf07a5874eebbfd3981c4f3f",
      "new_mode": 33188,
      "new_path": "tests/reflection_test.h"
    },
    {
      "type": "modify",
      "old_id": "68e8e68391ca4ba84cdd4c254bbed75e4fa51007",
      "old_mode": 33188,
      "old_path": "tests/test.cpp",
      "new_id": "5a43546f5348353fadeea15619631accba5f4d0d",
      "new_mode": 33188,
      "new_path": "tests/test.cpp"
    }
  ]
}
