)]}'
{
  "commit": "d2abcdc5727d0d4e31d6d9d5809aed25818d16a8",
  "tree": "e141c1793009ab7163e6ff28b03fde74a3c4da44",
  "parents": [
    "0b0209ca1aff9f7cd28150b5714cb6dd7514b313"
  ],
  "author": {
    "name": "Jakub Jelinek",
    "email": "jakub@redhat.com",
    "time": "Thu Aug 06 11:01:15 2026 +0200"
  },
  "committer": {
    "name": "Jakub Jelinek",
    "email": "jakub@gcc.gnu.org",
    "time": "Fri Aug 07 10:39:07 2026 +0200"
  },
  "message": "libcpp: Fix up ICE with __VA_OPT__ [PR125048]\n\nThe following testcase ICEs, because we call linemap_enter_macro\nand remember what it returned and then in a loop sometimes call\nvaopt_state::update (src) which can call expand_arg which under the\nhood can reallocate the pfile-\u003eline_table-\u003einfo_macro.maps array.\nAs linemap_enter_macro returns a pointer into that array, if the\narray is reallocated, we then dereference the freed memory.\n\nThe following patch fixes it by remembering the offset into the\npfile-\u003eline_table-\u003einfo_macro.maps array and when we could have called\nexpand_arg, updates the map variable so that it is correct even after\npossible reallocation.\n\n2026-04-28  Jakub Jelinek  \u003cjakub@redhat.com\u003e\n\n\tPR preprocessor/125048\n\t* macro.cc (replace_args): Remember the position of map\n\tin the pfile-\u003eline_table-\u003einfo_macro.maps array and if vostate\n\tis DROP, recompute map pointer as expand_arg call could have\n\treallocated the pfile-\u003eline_table-\u003einfo_macro.maps array.\n\n\t* c-c++-common/cpp/va-opt-11.c: New test.\n\nReviewed-by: Jason Merrill \u003cjason@redhat.com\u003e\n(cherry picked from commit 7b87f41690d46b869c21d0d0537b766698da3827)\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "68cf55817edaac094ad89a4fbb85908d23289af3",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/c-c++-common/cpp/va-opt-11.c"
    },
    {
      "type": "modify",
      "old_id": "c29a34302b63cbedd328f285fb50d8c2dd89b547",
      "old_mode": 33188,
      "old_path": "libcpp/macro.cc",
      "new_id": "15260a21b585e0c77e2bb2ae38e170a552dc3308",
      "new_mode": 33188,
      "new_path": "libcpp/macro.cc"
    }
  ]
}
