ASTree.cpp bugfix on line 1757, preventing error 'front called on empty vector'

This commit is contained in:
TrollerOfHolland
2022-06-23 01:16:41 +02:00
parent b0ce84234a
commit 25497aabb3

View File

@@ -1754,7 +1754,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
* If it's a comprehension, the only POP_TOP should be
* a call to append the iter to the list.
*/
if (value.type() == ASTNode::NODE_CALL) {
if (value.type() == ASTNode::NODE_CALL && !value.cast<ASTCall>()->pparams().empty() ) {
PycRef<ASTNode> res = value.cast<ASTCall>()->pparams().front();
stack.push(new ASTComprehension(res));