diff options
author | Eric Anholt <eric@anholt.net> | 2016-08-02 11:02:21 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-08-03 10:25:09 -0700 |
commit | a0671d67def9e83ae511f758091b87d4ac34bea4 (patch) | |
tree | 4125bf7dfe4da997378161d0ebb3070ee5be8813 | |
parent | 9f956909591fb259ce01f1882c3367978e8ec2fb (diff) | |
download | external_mesa3d-a0671d67def9e83ae511f758091b87d4ac34bea4.zip external_mesa3d-a0671d67def9e83ae511f758091b87d4ac34bea4.tar.gz external_mesa3d-a0671d67def9e83ae511f758091b87d4ac34bea4.tar.bz2 |
vc4: Fix a leak of the src[] array of VPM reads in optimization.
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
-rw-r--r-- | src/gallium/drivers/vc4/vc4_opt_vpm.c | 9 |
1 files 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; } |