mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 06:00:30 +00:00
MCParser: add an assertion
Add an assertion that the section is not NULL. Potential NULL pointer dereference identified by clang static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
705e53e2aa
commit
6785cf007c
@ -2694,7 +2694,9 @@ bool AsmParser::parseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
|
||||
// Check whether we should use optimal code alignment for this .align
|
||||
// directive.
|
||||
bool UseCodeAlign = getStreamer().getCurrentSection().first->UseCodeAlign();
|
||||
const MCSection *Section = getStreamer().getCurrentSection().first;
|
||||
assert(Section && "must have section to emit alignment");
|
||||
bool UseCodeAlign = Section->UseCodeAlign();
|
||||
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
|
||||
ValueSize == 1 && UseCodeAlign) {
|
||||
getStreamer().EmitCodeAlignment(Alignment, MaxBytesToFill);
|
||||
|
Loading…
Reference in New Issue
Block a user