Skip to content

Commit fb14fb6

Browse files
committed
Add missing null-check to substackEnd() in CompilerPrivate
This is only needed for tests where we can't set current block.
1 parent 4448fd9 commit fb14fb6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/engine/compiler_p.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ void CompilerPrivate::substackEnd()
4242
addInstruction(OP_ENDIF);
4343
break;
4444
}
45-
block = parent.first.first->next();
45+
46+
auto parentBlock = parent.first.first;
47+
48+
if (parentBlock)
49+
block = parentBlock->next();
50+
else
51+
block = nullptr;
52+
4653
substackTree.pop_back();
4754
if (!block && !substackTree.empty())
4855
substackEnd();

0 commit comments

Comments
 (0)