Avoid read past end of operands vector for EOpFrexp
authorDavid Neto <dneto@google.com>
Mon, 7 Dec 2015 21:17:06 +0000 (16:17 -0500)
committerDavid Neto <dneto@google.com>
Mon, 7 Dec 2015 21:24:31 +0000 (16:24 -0500)
commit8d63a3d35a931c5f514248feae6ddbd45f051391
tree6f509c45ba1d79a0cb24b6634703035341b91a9b
parent8c1c2ca0d7cd7b22e9843545c15fa475a3869625
Avoid read past end of operands vector for EOpFrexp

When emitting SPIR-V code for frexp, avoid access
beyond the end of the operands vector.  When constructing
the OpExtInst, construct a new arguments vector instead of
modifying the existing operands vector.  In the case of OpFrexp,
well need that last operand later on to generate the store.

Fixes https://github.com/KhronosGroup/glslang/issues/110

Change-Id: Ibc380fadf5e600ac491932e9ecef7afe2d72fd7f
SPIRV/GlslangToSpv.cpp