mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
fix: Multiple race conditions with pattern sorting
This commit is contained in:
@@ -9,7 +9,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void registerPatternLanguagePragmas() {
|
||||
|
||||
ContentRegistry::PatternLanguage::addPragma("base_address", [](const pl::PatternLanguage &runtime, const std::string &value) {
|
||||
ContentRegistry::PatternLanguage::addPragma("base_address", [](pl::PatternLanguage &runtime, const std::string &value) {
|
||||
auto baseAddress = strtoull(value.c_str(), nullptr, 0);
|
||||
|
||||
ImHexApi::Provider::get()->setBaseAddress(baseAddress);
|
||||
@@ -27,4 +27,4 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1343,8 +1343,8 @@ namespace hex::plugin::builtin {
|
||||
};
|
||||
|
||||
TextEditor::ErrorMarkers errorMarkers;
|
||||
if (!m_callStack->empty()) {
|
||||
for (const auto &frame : *m_callStack | std::views::reverse) {
|
||||
if (!(*m_callStack)->empty()) {
|
||||
for (const auto &frame : **m_callStack | std::views::reverse) {
|
||||
auto location = frame->getLocation();
|
||||
std::string message;
|
||||
if (location.source->source == pl::api::Source::DefaultSource) {
|
||||
@@ -1806,7 +1806,7 @@ namespace hex::plugin::builtin {
|
||||
if (!m_lastEvaluationResult) {
|
||||
*m_lastEvaluationError = runtime.getEvalError();
|
||||
*m_lastCompileError = runtime.getCompileErrors();
|
||||
*m_callStack = reinterpret_cast<const std::vector<const pl::core::ast::ASTNode *> &>(runtime.getInternals().evaluator->getCallStack());
|
||||
*m_callStack = &runtime.getInternals().evaluator->getCallStack();
|
||||
}
|
||||
|
||||
TaskManager::doLater([code] {
|
||||
|
||||
Reference in New Issue
Block a user