From 2a761f736a514b0de8499b8b1438526c8a6a36a1 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 16 Mar 2022 21:16:04 +0000 Subject: [PATCH] Fix oss-fuzz build failure A warning of a uint64_t -> size_t is causing the build to fail on 32-bit builds Bug: oss-fuzz:45451 Change-Id: Iffaf2818d187b0659c10bd75229bb7c03f4f69df Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/83841 Reviewed-by: Antonio Maiorano Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/tint/sem/bool_type.cc | 2 +- src/tint/sem/external_texture_type.cc | 2 +- src/tint/sem/f32_type.cc | 2 +- src/tint/sem/i32_type.cc | 2 +- src/tint/sem/u32_type.cc | 2 +- src/tint/sem/void_type.cc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tint/sem/bool_type.cc b/src/tint/sem/bool_type.cc index c8027a4f8c..d42f687cb4 100644 --- a/src/tint/sem/bool_type.cc +++ b/src/tint/sem/bool_type.cc @@ -28,7 +28,7 @@ Bool::Bool(Bool&&) = default; Bool::~Bool() = default; size_t Bool::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool Bool::Equals(const Type& other) const { diff --git a/src/tint/sem/external_texture_type.cc b/src/tint/sem/external_texture_type.cc index 1abe82567f..885bbae872 100644 --- a/src/tint/sem/external_texture_type.cc +++ b/src/tint/sem/external_texture_type.cc @@ -28,7 +28,7 @@ ExternalTexture::ExternalTexture(ExternalTexture&&) = default; ExternalTexture::~ExternalTexture() = default; size_t ExternalTexture::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool ExternalTexture::Equals(const sem::Type& other) const { diff --git a/src/tint/sem/f32_type.cc b/src/tint/sem/f32_type.cc index 62b964d769..2e666d55b2 100644 --- a/src/tint/sem/f32_type.cc +++ b/src/tint/sem/f32_type.cc @@ -28,7 +28,7 @@ F32::F32(F32&&) = default; F32::~F32() = default; size_t F32::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool F32::Equals(const Type& other) const { diff --git a/src/tint/sem/i32_type.cc b/src/tint/sem/i32_type.cc index 4631513462..47cd5a6cf3 100644 --- a/src/tint/sem/i32_type.cc +++ b/src/tint/sem/i32_type.cc @@ -28,7 +28,7 @@ I32::I32(I32&&) = default; I32::~I32() = default; size_t I32::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool I32::Equals(const Type& other) const { diff --git a/src/tint/sem/u32_type.cc b/src/tint/sem/u32_type.cc index 60bff9de5b..15801488b2 100644 --- a/src/tint/sem/u32_type.cc +++ b/src/tint/sem/u32_type.cc @@ -28,7 +28,7 @@ U32::~U32() = default; U32::U32(U32&&) = default; size_t U32::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool U32::Equals(const Type& other) const { diff --git a/src/tint/sem/void_type.cc b/src/tint/sem/void_type.cc index ff7e79e58e..e366e81203 100644 --- a/src/tint/sem/void_type.cc +++ b/src/tint/sem/void_type.cc @@ -28,7 +28,7 @@ Void::Void(Void&&) = default; Void::~Void() = default; size_t Void::Hash() const { - return TypeInfo::Of().full_hashcode; + return static_cast(TypeInfo::Of().full_hashcode); } bool Void::Equals(const Type& other) const {