AK: Don't try to free(UINTPTR_MAX) in StringData::operator delete()

...in constant-evaluated contexts. This was messing up GCC when building
the test262 runner. UINTPTR_MAX is the StringBase "invalid" tag.
This commit is contained in:
Andreas Kling 2025-03-26 12:50:15 +00:00
parent d8ff71fbb5
commit 8b8a61cf1c

View file

@ -66,7 +66,12 @@ public:
void operator delete(void* ptr)
{
free(ptr);
if (is_constant_evaluated()) {
if (reinterpret_cast<uintptr_t>(ptr) != UINTPTR_MAX)
free(ptr);
} else {
free(ptr);
}
}
~StringData()