Skip to content

Commit 7908b49

Browse files
committed
evaluator: Fix crash when error occurred in pointer-to type
1 parent d061314 commit 7908b49

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/source/pl/core/ast/ast_node_pointer_variable_decl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ namespace pl::core::ast {
9191

9292
std::vector<std::shared_ptr<ptrn::Pattern>> pointedAtPatterns;
9393
ON_SCOPE_EXIT {
94-
auto &pointedAtPattern = pointedAtPatterns.front();
94+
if (!pointedAtPatterns.empty()) {
95+
auto &pointedAtPattern = pointedAtPatterns.front();
96+
pattern->setPointedAtPattern(std::move(pointedAtPattern));
97+
}
9598

96-
pattern->setPointedAtPattern(std::move(pointedAtPattern));
9799
pattern->setSection(evaluator->getSectionId());
98100
};
99101

0 commit comments

Comments
 (0)