[llvm] r204114 - ARM: add an assertion

Saleem Abdulrasool compnerd at compnerd.org
Mon Mar 17 22:26:56 PDT 2014


Author: compnerd
Date: Tue Mar 18 00:26:55 2014
New Revision: 204114

URL: http://llvm.org/viewvc/llvm-project?rev=204114&view=rev
Log:
ARM: add an assertion

Add an assertion that a valid section is referenced.  The potential NULL pointer
dereference was identified by the clang static analyzer.

Modified:
    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=204114&r1=204113&r2=204114&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Mar 18 00:26:55 2014
@@ -8804,6 +8804,7 @@ bool ARMAsmParser::parseDirectiveEven(SM
     Section = getStreamer().getCurrentSection().first;
   }
 
+  assert(Section && "must have section to emit alignment");
   if (Section->UseCodeAlign())
     getStreamer().EmitCodeAlignment(2);
   else





More information about the llvm-commits mailing list