mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
Fix symbol collision in RenameReservedKeywords()
Fixed: tint:711 Bug: tint:712 Change-Id: I8d0b5c926772c4265d273f6420f101f48ac29b9c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47628 Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
ebc5bd4e28
commit
095cd1c255
@@ -67,6 +67,9 @@ void Transform::RenameReservedKeywords(CloneContext* ctx,
|
||||
const char* names[],
|
||||
size_t count) {
|
||||
ctx->ReplaceAll([=](Symbol in) {
|
||||
if (!ctx->src->Symbols().HasName(in)) {
|
||||
return ctx->dst->Symbols().New();
|
||||
}
|
||||
auto name_in = ctx->src->Symbols().NameFor(in);
|
||||
if (!std::binary_search(names, names + count, name_in)) {
|
||||
return ctx->dst->Symbols().Register(name_in);
|
||||
|
||||
Reference in New Issue
Block a user