forked from OSchip/llvm-project
asm goto: fix out-of-bounds read of Constraints after rC362045
When parsing goto labels, Names and Exprs are expanded but Constraints is not, this may cause a out-of-bounds read later in: // GCCAsmStmt::GCCAsmStmt // `constraints` has only `NumExprs - NumLabels` elements Constraints = new (C) StringLiteral*[NumExprs]; std::copy(constraints, constraints + NumExprs, Constraints); llvm-svn: 362067
This commit is contained in:
parent
bb4839d415
commit
9b8a0d7110
|
@ -846,6 +846,7 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
|
|||
ExprResult Res =
|
||||
Actions.ActOnAddrLabel(Tok.getLocation(), Tok.getLocation(), LD);
|
||||
Exprs.push_back(Res.get());
|
||||
Constraints.emplace_back();
|
||||
NumLabels++;
|
||||
ConsumeToken();
|
||||
if (!TryConsumeToken(tok::comma))
|
||||
|
|
Loading…
Reference in New Issue