1
0
mirror of synced 2024-11-28 17:40:51 +01:00

patterns: Properly set current base address in pattern language runtime

Fixes #714
This commit is contained in:
WerWolv 2022-09-03 22:04:41 +02:00
parent b68eb0bb5e
commit 4df1496a0f
2 changed files with 6 additions and 2 deletions

@ -1 +1 @@
Subproject commit 9f6f7fbb8d63fed1941196d43bc9e8d705234203
Subproject commit b4e973c3103a9244f2f304d55a7720a956a67f4e

View File

@ -812,9 +812,13 @@ namespace hex::plugin::builtin {
this->m_textEditor.SetErrorMarkers({});
this->m_console.clear();
auto &runtime = ProviderExtraData::getCurrent().patternLanguage.runtime;
auto provider = ImHexApi::Provider::get();
auto &runtime = ProviderExtraData::get(provider).patternLanguage.runtime;
runtime->reset();
runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns));
runtime->setDataBaseAddress(provider->getBaseAddress());
runtime->setDataSize(provider->getActualSize());
EventManager::post<EventHighlightingChanged>();