Commit fbd15e9
committed
opt: Fix build issue with gcc 16
Compiling with gcc 16 throws this error:
FAILED: [code=1] source/opt/CMakeFiles/SPIRV-Tools-opt.dir/decoration_manager.cpp.o
source/opt/decoration_manager.cpp: In member function
‘spvtools::opt::analysis::DecorationManager::CloneDecorations(unsigned int, unsigned int)’:
source/opt/decoration_manager.cpp:546:27: error:
‘MEM[(unsigned int &)&op + 24]’ may be used uninitialized [-Werror=maybe-uninitialized]
546 | if (op.words[0] == from) { // add new pair of operands: (to, literal)
source/opt/decoration_manager.cpp:545:19: note: ‘op’ declared here
545 | Operand op = inst->GetOperand(i);
| ^~
cc1plus: all warnings being treated as errors
Make sure that the vector is not empty before using it.1 parent cb38b23 commit fbd15e9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| |||
0 commit comments