)]}'
{
  "commit": "b5a3b874b8df2ea2ca82bd97fcd5906f7ebe82d8",
  "tree": "4e3e0a250be377351dae5a040f6241d556183b2a",
  "parents": [
    "81a0bec12189136350dbb43969743fab8b87a212"
  ],
  "author": {
    "name": "Jerry DeLisle",
    "email": "jvdelisle@gcc.gnu.org",
    "time": "Fri Jun 05 13:20:05 2026 -0700"
  },
  "committer": {
    "name": "Jerry DeLisle",
    "email": "jvdelisle@gcc.gnu.org",
    "time": "Sun Jun 07 12:34:02 2026 -0700"
  },
  "message": "fortran: [PR125535] wrong-code for implied-do with allocatable-component\n\nWhen a nested implied-do array constructor called a transformational\nintrinsic (e.g. RESHAPE) whose result type has allocatable components, the\nargument temporaries were freed before the result\u0027s allocatable components\nwere deep-copied, causing a heap-use-after-free and wrong runtime values.\n\nTransformational library functions such as RESHAPE do a shallow byte-copy\nof the source array into the result, so the result\u0027s component pointers\nalias those of the argument temporaries. Freeing the temporaries first\nand then copying yielded use-after-free.\n\nMove gfc_add_block_to_block (\u0026se-\u003epre, \u0026post) to after the deep-copy\nloop, so that the result\u0027s allocatable components are copied while the\nsource storage is still live.\n\nAssisted by: Claude Sonnet 4.6\n\n\tPR fortran/125535\n\ngcc/fortran/ChangeLog:\n\n\t* trans-expr.cc (gfc_conv_procedure_call): Move post block append\n\tto after the deep copy of allocatable components for transformational\n\tintrinsics, so that argument temporaries are not freed before the\n\tresult components are copied.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/implied_do_alloc_comp_1.f90: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c808c1b3ef32a5253e1c213fbe0a02982d40276e",
      "old_mode": 33188,
      "old_path": "gcc/fortran/trans-expr.cc",
      "new_id": "00925f2ef5af9478369e40bd351ba18e1b3d2688",
      "new_mode": 33188,
      "new_path": "gcc/fortran/trans-expr.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8f0ae4976d835c8752e2b46fbf8bf0a87aff7eed",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gfortran.dg/implied_do_alloc_comp_1.f90"
    }
  ]
}
