Mesa (staging/21.3): anv: Fix assertion.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 18 20:57:13 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: b9ea1b314d98a934a435a938f283595d3fefd62d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9ea1b314d98a934a435a938f283595d3fefd62d

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Sat Oct 16 22:34:25 2021 -0700

anv: Fix assertion.

Fix defect reported by Coverity Scan.

Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been intended

Fixes: 35315c68a57 ("anv: Use the common wrapper for GetPhysicalDeviceFormatProperties")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13395>
(cherry picked from commit 9eb010ee1e14feeaa43a5b538023b7b4352236e1)

---

 .pick_status.json              | 2 +-
 src/intel/vulkan/anv_formats.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index ccf28ae86dc..cbadb04e8c4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -274,7 +274,7 @@
         "description": "anv: Fix assertion.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "35315c68a574505a5b2cecaa64612fb8cffa8515"
     },
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index ab29fe76d7d..eabe7c0fb7b 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -930,7 +930,7 @@ void anv_GetPhysicalDeviceFormatProperties2(
    const struct intel_device_info *devinfo = &physical_device->info;
    const struct anv_format *anv_format = anv_get_format(vk_format);
 
-   assert(pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
+   assert(pFormatProperties->sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
 
    VkFormatFeatureFlags2KHR linear2, optimal2, buffer2;
    linear2 = anv_get_image_format_features2(devinfo, vk_format, anv_format,



More information about the mesa-commit mailing list