ARM: add an assertion
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 18 Mar 2014 05:26:55 +0000 (05:26 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 18 Mar 2014 05:26:55 +0000 (05:26 +0000)
Add an assertion that a valid section is referenced.  The potential NULL pointer
dereference was identified by the clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204114 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 403e147a6abd21d8cdcbbe25464d1d25925641ef..ccb1c641efeb725ad3c3d1a4ca8e6484628f57a4 100644 (file)
@@ -8804,6 +8804,7 @@ bool ARMAsmParser::parseDirectiveEven(SMLoc L) {
     Section = getStreamer().getCurrentSection().first;
   }
 
+  assert(Section && "must have section to emit alignment");
   if (Section->UseCodeAlign())
     getStreamer().EmitCodeAlignment(2);
   else