includes/std: Allow std::mem::MagicSearch to work with non-zero base addresses

This commit is contained in:
Nik
2023-07-13 12:10:54 +02:00
committed by GitHub
parent 4587b465d4
commit ab43516517

View File

@@ -9,7 +9,7 @@ namespace std::mem {
namespace impl {
struct MagicSearchImpl<auto Magic, T> {
if ($ < (std::mem::size() - std::string::length(Magic) - 1)) {
if ($ < (std::mem::base_address() + std::mem::size() - std::string::length(Magic) - 1)) {
char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]];
if (__potentialMagic__ == Magic) {