mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
nir: fix warning in nir_lower_io.c
Initialize the variable with NULL. Fixes the following
In file included from ../src/compiler/nir/nir_lower_io.c:34:
../src/compiler/nir/nir_lower_io.c: In function ‘nir_lower_explicit_io’:
../src/compiler/nir/nir.h:668:11: warning: ‘addr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return src;
^~~
../src/compiler/nir/nir_lower_io.c:735:17: note: ‘addr’ was declared here
nir_ssa_def *addr;
^~~~
v2: Avoid using a 'default' case so we get help from the compiler when
new deref types are added. (Lionel)
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
3cb65cf8aa
commit
baabfb1959
1 changed files with 1 additions and 1 deletions
|
|
@ -732,7 +732,7 @@ lower_explicit_io_deref(nir_builder *b, nir_deref_instr *deref,
|
|||
assert(deref->parent.is_ssa);
|
||||
nir_ssa_def *parent_addr = deref->parent.ssa;
|
||||
|
||||
nir_ssa_def *addr;
|
||||
nir_ssa_def *addr = NULL;
|
||||
assert(deref->dest.is_ssa);
|
||||
switch (deref->deref_type) {
|
||||
case nir_deref_type_var:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue