WireCmd: Use WGPUBool for all transfer booleans.
Otherwise some garbage could be inserted, causing UBSan to complain
about "Invalid-bool-value".
Conversion from-to uint32_t (which is WGPUBool) is well defined, so use
this type instead of a plain C++ bool.
Bug: 349626769
Change-Id: I0ff10a04ea53a12f44202d59329e80e406110ce1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/197174
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/generator/templates/dawn/wire/WireCmd.cpp b/generator/templates/dawn/wire/WireCmd.cpp
index dd92f2e..39c34cf 100644
--- a/generator/templates/dawn/wire/WireCmd.cpp
+++ b/generator/templates/dawn/wire/WireCmd.cpp
@@ -138,7 +138,7 @@
//* Start the transfer structure with the command ID, so that casting to WireCmd gives the ID.
{{Return}}WireCmd commandId;
{% elif record.extensible %}
- bool hasNextInChain;
+ WGPUBool hasNextInChain;
{% elif record.chained %}
WGPUChainedStructTransfer chain;
{% endif %}
@@ -158,7 +158,7 @@
{% endif %}
//* Optional members additionally come with a boolean to indicate whether they were set.
{% if member.optional and member.type.category != "object" %}
- bool has_{{as_varName(member.name)}};
+ WGPUBool has_{{as_varName(member.name)}};
{% endif %}
{% endfor %}
};