MIRParser: Avoid reading uninitialized memory on generic vregs
authorJustin Bogner <mail@justinbogner.com>
Fri, 17 Nov 2017 18:51:20 +0000 (18:51 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 17 Nov 2017 18:51:20 +0000 (18:51 +0000)
commit6c7663fd5408b993f3fe2cad4495bd14ce459715
tree3017c3497972a4c7e19753a730e2834dc12cc33b
parent7834009726001b0858eeefcb310fc59d39b4c063
MIRParser: Avoid reading uninitialized memory on generic vregs

If a vreg's bank is specified in the registers block and one of its
defs or uses also specifies the bank, we end up checking that the
RegBank is equal to diagnose conflicting banks. The problem comes up
for generic vregs, where we weren't fully initializing the VRegInfo
when parsing the registers block, so we'd end up comparing a null
pointer to uninitialized memory.

This fixes a non-deterministic failure when round tripping through MIR
with generic vregs.

llvm-svn: 318543
llvm/lib/CodeGen/MIRParser/MIRParser.cpp