From 249f3d73cf5e9d22c592a619830a2f40912e6197 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 12 Apr 2013 00:22:30 +0100 Subject: nv50/codegen: do not emitATOM() if the subOp is unknown For debug build we'll hit the assert, for release we are going to emit random data as subOp is used uninitilised. Spotted by gcc codegen/nv50_ir_emit_nv50.cpp: In member function 'void nv50_ir::CodeEmitterNV50::emitATOM(const nv50_ir::Instruction*)': codegen/nv50_ir_emit_nv50.cpp:1554:12: warning: 'subOp' may be used uninitialized in this function [-Wmaybe-uninitialized] uint8_t subOp; ^ Signed-off-by: Emil Velikov --- src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers/nv50/codegen') diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp index 2638ef1399d..bc5a833743b 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp @@ -1565,7 +1565,7 @@ CodeEmitterNV50::emitATOM(const Instruction *i) case NV50_IR_SUBOP_ATOM_EXCH: subOp = 0x1; break; default: assert(!"invalid subop"); - break; + return; } code[0] = 0xd0000001; code[1] = 0xe0c00000 | (subOp << 2); -- cgit v1.2.3