summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2021-05-08 17:23:52 -0700
committerVinson Lee <vlee@freedesktop.org>2021-05-12 22:18:30 -0700
commitc89241211103d95f07eb0d66226c12bb28b146cc (patch)
tree113499b00294b5c0afc509ce1222f2a65d7b3f6a /src/gallium/drivers
parent77d959814c721ffaa9bd43366f6ebe9365684709 (diff)
nvc0/ir: Initialize CodeEmitterGK110 member progType in constructor.
Fix defect reported by Coverity Scan. Uninitialized scalar field (UNINIT_CTOR) uninit_member: Non-static class member progType is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10715>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
index 02d0e3d6adb..46354a2bd71 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -29,14 +29,12 @@ namespace nv50_ir {
class CodeEmitterGK110 : public CodeEmitter
{
public:
- CodeEmitterGK110(const TargetNVC0 *);
+ CodeEmitterGK110(const TargetNVC0 *, Program::Type);
virtual bool emitInstruction(Instruction *);
virtual uint32_t getMinEncodingSize(const Instruction *) const;
virtual void prepareEmission(Function *);
- inline void setProgramType(Program::Type pType) { progType = pType; }
-
private:
const TargetNVC0 *targNVC0;
@@ -2793,9 +2791,10 @@ CodeEmitterGK110::prepareEmission(Function *func)
calculateSchedDataNVC0(targ, func);
}
-CodeEmitterGK110::CodeEmitterGK110(const TargetNVC0 *target)
+CodeEmitterGK110::CodeEmitterGK110(const TargetNVC0 *target, Program::Type type)
: CodeEmitter(target),
targNVC0(target),
+ progType(type),
writeIssueDelays(target->hasSWSched)
{
code = NULL;
@@ -2806,8 +2805,7 @@ CodeEmitterGK110::CodeEmitterGK110(const TargetNVC0 *target)
CodeEmitter *
TargetNVC0::createCodeEmitterGK110(Program::Type type)
{
- CodeEmitterGK110 *emit = new CodeEmitterGK110(this);
- emit->setProgramType(type);
+ CodeEmitterGK110 *emit = new CodeEmitterGK110(this, type);
return emit;
}