AK: Don't try to free(UINTPTR_MAX) in StringData::operator delete()
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

...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 committed by Tim Flynn
parent 85e28a29f0
commit 693fe76d1c
Notes: github-actions[bot] 2025-03-26 14:48:52 +00:00

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()