ARM: prevent crash on ELF directives on COFF
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 18 Sep 2014 04:28:29 +0000 (04:28 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 18 Sep 2014 04:28:29 +0000 (04:28 +0000)
commit9c00ddb8d5c6be2286a3a66ccec6c6ecc682295b
tree4f0fb5a1a7dfd0764331c7892b76100c06553595
parent3ff76847baebdc6f7256a5bdb0056191ce00f4a0
ARM: prevent crash on ELF directives on COFF

Certain directives are unsupported on Windows (some of which could/should be
supported).  We would not diagnose the use but rather crash during the emission
as we try to access the Target Streamer.  Add an assertion to prevent creating a
NULL reference (which is not permitted under C++) as well as a test to ensure
that we can diagnose the disabled directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218014 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/directive-unsupported.s [new file with mode: 0644]