Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,12 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
stack_hist.pop();
}

if (blocks.size() == 1 && !source.atEof()) {
fprintf(stderr, "Warning: Refusing to pop last block when there is more code to parse pos: %d OP: %02x\n", pos, opcode & 0xff);
cleanBuild = false;
break;
}

PycRef<ASTBlock> prev = curblock;
PycRef<ASTBlock> nil;
bool push = true;
Expand Down Expand Up @@ -1589,6 +1595,12 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
curblock->removeLast();
}

if (blocks.size() == 1 && !source.atEof()) {
fprintf(stderr, "Warning: Refusing to pop last block when there is more code to parse pos: %d OP: %02x\n", pos, opcode & 0xff);
cleanBuild = false;
break;
}

if (curblock->blktype() == ASTBlock::BLK_IF
|| curblock->blktype() == ASTBlock::BLK_ELIF
|| curblock->blktype() == ASTBlock::BLK_ELSE
Expand Down