nv50/ir: fix use-after-free in ConstantFolding::visit
authorKarol Herbst <kherbst@redhat.com>
Fri, 7 Dec 2018 08:44:55 +0000 (09:44 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sun, 9 Dec 2018 17:19:59 +0000 (18:19 +0100)
commit77944fb2b7c9b40539084f600b5df4fff18e9640
tree18df186daef64746c8c119ff34a88035b570f3a4
parentd63a13308229b5c5a08358ccacdac83272596c78
nv50/ir: fix use-after-free in ConstantFolding::visit

opnd() might delete the passed in instruction, but it's used through
i->srcExists() later in visit

v2: use continue instead return
v3: use brackets for the outer if/else chain

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp