James-Jones / HLSLCrossCompiler

Other
468 stars 81 forks source link

Uninitialized memory on decode may be misinterpreted in later passes #38

Open TiemoJung opened 7 years ago

TiemoJung commented 7 years ago

Hi,

just debugged a wrong shader. Root cause was uninitialized memory of a instruction. I just happened that one operator of an instruction was an input register and its special name was by chance 7 (index id) which resulted in wrong output.

A memset(psInst, 0, sizeof(Instruction) * ui32ShaderLength); after the psInst = hlslcc_malloc(sizeof(Instruction) * ui32ShaderLength); in decode.c (1376) got rid of it.