mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
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:
parent
d8ff71fbb5
commit
8b8a61cf1c
1 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue