mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
fix PR5983, reject function bodies with no blocks per the grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
873187c042
commit
2fdf8dbed5
@ -2779,6 +2779,10 @@ bool LLParser::ParseFunctionBody(Function &Fn) {
|
||||
|
||||
PerFunctionState PFS(*this, Fn, FunctionNumber);
|
||||
|
||||
// We need at least one basic block.
|
||||
if (Lex.getKind() == lltok::rbrace || Lex.getKind() == lltok::kw_end)
|
||||
return TokError("function body requires at least one basic block");
|
||||
|
||||
while (Lex.getKind() != lltok::rbrace && Lex.getKind() != lltok::kw_end)
|
||||
if (ParseBasicBlock(PFS)) return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user