Fix for if 1 in 2.3.
I remain ever so midly concerned that this shouldn't exist at all.
This commit is contained in:
11
ASTree.cpp
11
ASTree.cpp
@@ -1034,8 +1034,10 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
break;
|
||||
}
|
||||
|
||||
if (curblock->blktype() == ASTBlock::BLK_WHILE
|
||||
&& !curblock->inited()) {
|
||||
if ((curblock->blktype() == ASTBlock::BLK_WHILE
|
||||
&& !curblock->inited())
|
||||
|| (curblock->blktype() == ASTBlock::BLK_IF
|
||||
&& curblock->size() == 0)) {
|
||||
PycRef<PycObject> fakeint = new PycInt(1);
|
||||
PycRef<ASTNode> truthy = new ASTObject(fakeint);
|
||||
|
||||
@@ -1094,6 +1096,11 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
stack_hist.pop();
|
||||
}
|
||||
push = false;
|
||||
|
||||
if (prev->blktype() == ASTBlock::BLK_MAIN) {
|
||||
/* Something went out of control! */
|
||||
prev = nil;
|
||||
}
|
||||
} else if (prev->blktype() == ASTBlock::BLK_TRY
|
||||
&& prev->end() < pos+operand) {
|
||||
/* Need to add an except/finally block */
|
||||
|
Reference in New Issue
Block a user