)]}'
{
  "commit": "4a62a93e27d97c8ada63aa193c5d071acd5b9645",
  "tree": "fd97ca4f3099486d7edcf2b11f9d8d7b170d6290",
  "parents": [
    "5c95af798ba41e5c8bb09891ee7398e7bfe2b1fb"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Fri Nov 03 21:41:48 2023 -0400"
  },
  "committer": {
    "name": "swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Nov 08 01:16:19 2023 +0000"
  },
  "message": "Fix some more UBSan errors in swiftshader\n\nVkPipelineLayout.cpp had a memcpy call that could be passed NULL, 0.\nSwitch to std::copy which avoids this and also a manual sizeof\nmultiplication.\n\nVkStructConversion.cpp is a bit more fun. It manually lays out a bunch\nof arrays in a single structure. Almost all fields in the array provide\n8-byte alignment, except for VkPipelineStageFlags. If there are an odd\nnumber of VkPipelineStageFlags, subsequent fields become misaligned.\nThis is undefined not only by C/C++ (it is forbidden to cast unaligned\npointers), but also Vulkan itself if I\u0027m understanding the spec right:\nhttps://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fundamentals-validusage-pointers\n\n(Although Vulkan saying it is somewhat redundant because merely having\nthose pointer types in the type signature means you must keep them\naligned by C/C++\u0027s rules.)\n\nFix this by rounding all the array sizes up to a multiple of 8. This is\na no-op for everything but the VkPipelineStageFlags fields, but I\napplied it to all fields so it is more obviously correct. The compiler\nis smart enough to optimize this out per [0].\n\n[0] https://godbolt.org/z/nfM3Y6xfo\n\nBug: chromium:1394755\nChange-Id: I950869e4fed969351ac1aefddd72a898b43cfdc1\nReviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/72628\nTested-by: Shahbaz Youssefi \u003csyoussefi@google.com\u003e\nPresubmit-Ready: Shahbaz Youssefi \u003csyoussefi@google.com\u003e\nCommit-Queue: Shahbaz Youssefi \u003csyoussefi@google.com\u003e\nReviewed-by: Shahbaz Youssefi \u003csyoussefi@google.com\u003e\nKokoro-Result: kokoro \u003cnoreply+kokoro@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f6d19170c3d72fb8c7a6ddb6ffde199aebd2845a",
      "old_mode": 33188,
      "old_path": "src/Vulkan/VkPipelineLayout.cpp",
      "new_id": "f9724962fe17c12d71fa306d34d58023f432241b",
      "new_mode": 33188,
      "new_path": "src/Vulkan/VkPipelineLayout.cpp"
    },
    {
      "type": "modify",
      "old_id": "94563cbc68fd702b33bee4500d0aae9abcb5fea1",
      "old_mode": 33188,
      "old_path": "src/Vulkan/VkStructConversion.hpp",
      "new_id": "7c970e31a22e5783cb16fc64a6e5f244663389d9",
      "new_mode": 33188,
      "new_path": "src/Vulkan/VkStructConversion.hpp"
    }
  ]
}
