Fixed crash on stack_history being empty

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez Murcia
2020-02-10 11:02:26 +01:00
parent 3d3719f844
commit eae19d7a81

View File

@@ -1395,8 +1395,12 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|| curblock->blktype() == ASTBlock::BLK_TRY
|| curblock->blktype() == ASTBlock::BLK_EXCEPT
|| curblock->blktype() == ASTBlock::BLK_FINALLY) {
stack = stack_hist.top();
stack_hist.pop();
if (!stack_hist.empty()) {
stack = stack_hist.top();
stack_hist.pop();
} else {
fprintf(stderr, "Warning: Stack history is empty, something wrong might have happened\n");
}
}
tmp = curblock;