mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
tests: Fixed compile errors
This commit is contained in:
@@ -1425,7 +1425,7 @@ namespace hex::pl {
|
||||
literal = pattern->clone();
|
||||
}
|
||||
|
||||
if (auto transformFunc = pattern->getTransformFunction(); transformFunc.has_value()) {
|
||||
if (auto transformFunc = pattern->getTransformFunction(); transformFunc.has_value() && pattern->getEvaluator() != nullptr) {
|
||||
auto result = transformFunc->func(evaluator, { literal });
|
||||
|
||||
if (!result.has_value())
|
||||
|
||||
@@ -56,15 +56,21 @@ namespace hex::pl {
|
||||
class PatternCreationLimiter {
|
||||
public:
|
||||
explicit PatternCreationLimiter(Evaluator *evaluator) : m_evaluator(evaluator) {
|
||||
if (this->m_evaluator == nullptr) return;
|
||||
|
||||
this->m_evaluator->patternCreated();
|
||||
}
|
||||
|
||||
PatternCreationLimiter(const PatternCreationLimiter &other) {
|
||||
if (this->m_evaluator == nullptr) return;
|
||||
|
||||
this->m_evaluator = other.m_evaluator;
|
||||
this->m_evaluator->patternCreated();
|
||||
}
|
||||
|
||||
~PatternCreationLimiter() {
|
||||
if (this->m_evaluator == nullptr) return;
|
||||
|
||||
this->m_evaluator->patternDestroyed();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user