From 73c33803359dcb378c040abcc3f517fa4ea65646 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2020 22:04:53 -0800 Subject: [PATCH] mesa: Remove extra texObj. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix defect reported by Coverity Scan. Evaluation order violation (EVALUATION_ORDER) write_write_typo: In texObj = texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt], texObj is written twice with the same value. Fixes: d0e18550e26 ("mesa: optimize saving/restoring bound textures for glPush/PopAttrib") Signed-off-by: Vinson Lee Reviewed-by: Lionel Landwerlin Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/attrib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 11677eb2c3a..51c3bc326d5 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -591,7 +591,7 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { const struct gl_texture_object *savedObj = &texstate->SavedObj[u][tgt]; struct gl_texture_object *texObj = - texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt]; + _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt]; if (texObj->Name != savedObj->Name) { /* We don't need to check whether the texture target is supported,