From ced92a047e510480cff15be1a1cd102abffa3f82 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 7 Sep 2017 09:50:50 -0700 Subject: Fixup: fix uninitialized memory bug This is a bug that already existed in the IR code, but wasn't getting triggered on existing test cases, and only seems to affect the 64-bit target right now. The "key" value being constructed to cache and re-use constants during IR generation wasn't actually being fully initialized, and so garbage values in it could cause the lookup of an existing value to fail where it should succeed. --- source/slang/ir.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp index e3647a47b..eadcd34d0 100644 --- a/source/slang/ir.cpp +++ b/source/slang/ir.cpp @@ -569,6 +569,7 @@ namespace Slang IRParentInst* parent = builder->shared->module; IRConstant keyInst; + memset(&keyInst, 0, sizeof(keyInst)); keyInst.op = op; keyInst.type.usedValue = type; memcpy(&keyInst.u, value, valueSize); -- cgit v1.2.3