dawn-cmake/generator
Corentin Wallez 75f554d973 WireCmd: disallow optional members with length="otherMember"
This didn't make sense since these members can be specified to have no
data by setting the length to 0.

 - Prevent uses of this patten by adding an assert in WireCmd.cpp's
   generator.
 - Fix SetBindGroup dynamicOffset to not be optional but default to
   nullptr instead.

This issues would cause a read of uninitialized pointers becaus the
generator code looked like this:

  SetBindGroupCmd cmd;
  cmd.dynamicOffsetCount = record.dynamicOffsetCount; // 1
  bool has_dynamicOffset = record.has_dynamicOffsetl // false
  if (has_dynamicOffset) {
    cmd.dynamicOffsets = ...;
  }
  // Oh no! dynamicOffsets contains garbage even if dynamicOffsetCount
  // is set to 1. dawn_native will happily read it.

Bug: chromium:1220036
Change-Id: I5c468b639f671cef3be2fa64667a0bf114fc902b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54643
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2021-06-17 16:04:29 +00:00
..
templates WireCmd: disallow optional members with length="otherMember" 2021-06-17 16:04:29 +00:00
BUILD.gn Add .clang-format files and format more files 2020-07-15 19:51:17 +00:00
CMakeLists.txt CMakeLists: make DAWN_THIRD_PARTY_DIR an option. 2020-10-20 14:26:10 +00:00
dawn_generator.gni BUILD.gn: Delete stale generated files in Dawn's gen dir. 2019-09-19 23:30:42 +00:00
dawn_json_generator.py Add utilities for printing Dawn enums and bitmasks 2021-06-01 18:49:12 +00:00
extract_json.py Avoid unnecessary recompiles with code generators. 2021-03-23 19:06:02 +00:00
generator_lib.gni Add .clang-format files and format more files 2020-07-15 19:51:17 +00:00
generator_lib.py Skip None paths when looking for modules 2020-10-20 14:46:10 +00:00
opengl_loader_generator.py Fixes for OpenGL loader generator. 2021-05-06 18:34:14 +00:00
remove_files.py Add .clang-format files and format more files 2020-07-15 19:51:17 +00:00