Skip to content

Commit

Permalink
SIL: fix parsing of "object" instructions with don't have tail elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
eeckstein committed Aug 30, 2017
1 parent cbcde4e commit ae33dd0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/ParseSIL/ParseSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3767,21 +3767,18 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
return true;

// Parse a list of SILValue.
bool OpsAreTailElems = false;
unsigned NumBaseElems = 0;
if (P.Tok.isNot(tok::r_paren)) {
do {
if (Opcode == ValueKind::ObjectInst) {
bool StartOfTailElems = false;
if (parseSILOptional(StartOfTailElems, *this, "tail_elems"))
if (parseSILOptional(OpsAreTailElems, *this, "tail_elems"))
return true;
if (StartOfTailElems) {
if (NumBaseElems)
return true;
NumBaseElems = OpList.size();
}
}
if (parseTypedValueRef(Val, B)) return true;
OpList.push_back(Val);
if (!OpsAreTailElems)
NumBaseElems = OpList.size();
} while (P.consumeIf(tok::comma));
}
if (P.parseToken(tok::r_paren,
Expand Down

0 comments on commit ae33dd0

Please sign in to comment.