Mesa (master): vc4: Fix a leak of the src[] array of VPM reads in optimization.

Eric Anholt anholt at kemper.freedesktop.org
Wed Aug 3 17:59:15 UTC 2016


Module: Mesa
Branch: master
Commit: a0671d67def9e83ae511f758091b87d4ac34bea4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0671d67def9e83ae511f758091b87d4ac34bea4

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug  2 11:02:21 2016 -0700

vc4: Fix a leak of the src[] array of VPM reads in optimization.

Cc: "12.0" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/vc4/vc4_opt_vpm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_opt_vpm.c b/src/gallium/drivers/vc4/vc4_opt_vpm.c
index 34ea336..83ba11b 100644
--- a/src/gallium/drivers/vc4/vc4_opt_vpm.c
+++ b/src/gallium/drivers/vc4/vc4_opt_vpm.c
@@ -115,11 +115,12 @@ qir_opt_vpm(struct vc4_compile *c)
                          * sources are independent of previous instructions
                          */
                         if (temps == 1) {
-                                list_del(&inst->link);
                                 inst->src[j] = mov->src[0];
-                                list_replace(&mov->link, &inst->link);
-                                c->defs[temp] = NULL;
-                                free(mov);
+
+                                list_del(&inst->link);
+                                list_addtail(&inst->link, &mov->link);
+                                qir_remove_instruction(c, mov);
+
                                 progress = true;
                                 break;
                         }




More information about the mesa-commit mailing list