Fix nullptr deref for rebased method
This commit is contained in:
@@ -57,7 +57,7 @@ void MacroEngine::Execute(Engines::Maxwell3D& maxwell3d, u32 method,
|
|||||||
cache_info.hash = boost::hash_value(macro_code->second);
|
cache_info.hash = boost::hash_value(macro_code->second);
|
||||||
} else {
|
} else {
|
||||||
const auto& macro_cached = uploaded_macro_code[mid_method.value()];
|
const auto& macro_cached = uploaded_macro_code[mid_method.value()];
|
||||||
const auto rebased_method = method - macro_code->first;
|
const auto rebased_method = method - mid_method.value();
|
||||||
auto& code = uploaded_macro_code[method];
|
auto& code = uploaded_macro_code[method];
|
||||||
code.resize(macro_cached.size() - rebased_method);
|
code.resize(macro_cached.size() - rebased_method);
|
||||||
std::memcpy(code.data(), macro_cached.data() + rebased_method,
|
std::memcpy(code.data(), macro_cached.data() + rebased_method,
|
||||||
|
|||||||
Reference in New Issue
Block a user