Add assert in GenericValue constant access

While debugging the 1.2.1 dEQP-VK.graphicsfuzz.* tests, noticed a crash
here where a non-constant failed to have its intermediate pointer set.

An assert here is clearer than exploding.

Bug: b/146653181
Change-Id: I23aae701edce1595cd145930d304c9f6e4b82924
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39808
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp
index ecc3f5b..db83240 100644
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -950,6 +950,7 @@
 			// Constructing a constant SIMD::Float is not guaranteed to preserve the data's exact
 			// bit pattern, but SPIR-V provides 32-bit words representing "the bit pattern for the constant".
 			// Thus we must first construct an integer constant, and bitcast to float.
+			ASSERT(obj.kind == SpirvShader::Object::Kind::Constant);
 			auto constantValue = reinterpret_cast<uint32_t *>(obj.constantValue.get());
 			return As<SIMD::Float>(SIMD::UInt(constantValue[i]));
 		}
@@ -960,6 +961,7 @@
 			{
 				return intermediate->Int(i);
 			}
+			ASSERT(obj.kind == SpirvShader::Object::Kind::Constant);
 			auto constantValue = reinterpret_cast<int *>(obj.constantValue.get());
 			return SIMD::Int(constantValue[i]);
 		}
@@ -970,6 +972,7 @@
 			{
 				return intermediate->UInt(i);
 			}
+			ASSERT(obj.kind == SpirvShader::Object::Kind::Constant);
 			auto constantValue = reinterpret_cast<uint32_t *>(obj.constantValue.get());
 			return SIMD::UInt(constantValue[i]);
 		}