[AVR] Fix read of uninitialized variable AVRSubtarget:::ELFArch
authorDylan McKay <me@dylanmckay.io>
Thu, 12 Mar 2020 11:03:30 +0000 (00:03 +1300)
committerDylan McKay <me@dylanmckay.io>
Thu, 12 Mar 2020 11:09:13 +0000 (00:09 +1300)
commit13be27482e5300ac8d7cafacd8a046a6611ad1c4
tree8512f4721ab16c105d0cd2addf26f6183e08d408
parent57e81a2f649099229e1d50b36aeee5eb1b9e3d49
[AVR] Fix read of uninitialized variable AVRSubtarget:::ELFArch

Found by the LLVM MemorySanitizer tests when switching AVR to a default
backend.

ELFArch must be initialized before the call to
initializeSubtargetDependencies().

The uninitialized read would occur deep within TableGen'd code.
llvm/lib/Target/AVR/AVRSubtarget.cpp
llvm/lib/Target/AVR/AVRSubtarget.h