From: Saleem Abdulrasool Date: Tue, 18 Mar 2014 05:26:55 +0000 (+0000) Subject: ARM: add an assertion X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=96be4240bbd7087168240e486d194beb98278db7;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204114 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 403e147a6ab..ccb1c641efe 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -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