[MC] Don't crash when .word is given bogus values
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 26 Oct 2015 02:45:50 +0000 (02:45 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 26 Oct 2015 02:45:50 +0000 (02:45 +0000)
commit7e2b51ddb0c31251240930f408c8f60aac2448ed
treea9b1cf6a13d673e6a58462a364d756c14f905c22
parentaaf72bc7c6afd0ec80978baf3e6a2ca5b4011914
[MC] Don't crash when .word is given bogus values

We didn't validate that the .word directive was given a sane value,
leading to crashes when we attempt to write out the object file.

Instead, perform some validation and issue a diagnostic pointing at the
start of the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251270 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/AsmParser/exprs-invalid.s