diff options
author | Tiziano Bacocco <tizbac2@gmail.com> | 2013-07-30 22:04:49 +0200 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2013-10-02 21:46:35 -0700 |
commit | 2e8bcfa56dcdebfa31c729ebc23755c5480667f4 (patch) | |
tree | 10044170bf81ccf4e56613c38ffe448eb07ab3a9 | |
parent | fa5554fce7d8e7364786385c086a58a2d2953462 (diff) |
nvc0/ir: fix use after free in texture barrier insertion pass
Fixes crash with Amnesia: The Dark Descent.
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7086636358b611a2bb124253e1fe870107e1cecb)
-rw-r--r-- | src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp index c5a7772ed9f..cfd1f882ce8 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp @@ -441,6 +441,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (i->op == OP_TEXBAR) { if (i->subOp >= max) { delete_Instruction(prog, i); + i = NULL; } else { max = i->subOp; if (prev && prev->op == OP_TEXBAR && prev->subOp >= max) { @@ -452,7 +453,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn) if (isTextureOp(i->op)) { max++; } - if (!i->isNop()) + if (i && !i->isNop()) prev = i; } } |