Skip to content

Commit 7daf3b3

Browse files
committed
evaluator: Don't try to process attributes while an exception was thrown
1 parent b0342bd commit 7daf3b3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ namespace pl::core::ast {
158158
}
159159

160160
void applyTypeAttributes(Evaluator *evaluator, const ASTNode *node, const std::shared_ptr<ptrn::Pattern> &pattern) {
161+
if (std::uncaught_exceptions() > 0)
162+
return;
163+
161164
auto attributable = dynamic_cast<const Attributable *>(node);
162165
if (attributable == nullptr)
163166
err::E0008.throwError("Attributes cannot be applied to this statement.", {}, node->getLocation());
@@ -369,6 +372,8 @@ namespace pl::core::ast {
369372
}
370373

371374
void applyVariableAttributes(Evaluator *evaluator, const ASTNode *node, const std::shared_ptr<ptrn::Pattern> &pattern) {
375+
if (std::uncaught_exceptions() > 0)
376+
return;
372377

373378
auto attributable = dynamic_cast<const Attributable *>(node);
374379
if (attributable == nullptr)

0 commit comments

Comments
 (0)