mirror of https://github.com/WerWolv/ImHex.git
patterns: Fixed auto parameter crash
This commit is contained in:
parent
559b86efe1
commit
8b2dcf976f
|
@ -41,7 +41,9 @@ namespace hex::pl {
|
||||||
|
|
||||||
bool referenceType = false;
|
bool referenceType = false;
|
||||||
|
|
||||||
if (type == nullptr) {
|
auto typePattern = type->createPatterns(this);
|
||||||
|
|
||||||
|
if (typePattern.empty()) {
|
||||||
// Handle auto variables
|
// Handle auto variables
|
||||||
if (!value.has_value())
|
if (!value.has_value())
|
||||||
LogConsole::abortEvaluation("cannot determine type of auto variable", type);
|
LogConsole::abortEvaluation("cannot determine type of auto variable", type);
|
||||||
|
@ -64,7 +66,7 @@ namespace hex::pl {
|
||||||
} else
|
} else
|
||||||
LogConsole::abortEvaluation("cannot determine type of auto variable", type);
|
LogConsole::abortEvaluation("cannot determine type of auto variable", type);
|
||||||
} else {
|
} else {
|
||||||
pattern = std::move(type->createPatterns(this).front());
|
pattern = std::move(typePattern.front());
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern->setVariableName(name);
|
pattern->setVariableName(name);
|
||||||
|
|
Loading…
Reference in New Issue