From fcac134af0d920c259589911d94d3cdc2fddfec0 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 12 Dec 2024 23:13:39 -0600 Subject: [PATCH] [ox/std] Make source_location::current only init if valid --- deps/nostalgia/deps/ox/src/ox/std/source_location.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/nostalgia/deps/ox/src/ox/std/source_location.hpp b/deps/nostalgia/deps/ox/src/ox/std/source_location.hpp index 66195e0..54bff14 100644 --- a/deps/nostalgia/deps/ox/src/ox/std/source_location.hpp +++ b/deps/nostalgia/deps/ox/src/ox/std/source_location.hpp @@ -40,7 +40,9 @@ class source_location { static consteval source_location current(Raw const pSl = __builtin_source_location()) noexcept { source_location sl; - sl.m_data = static_cast<__impl const*>(pSl); + if (pSl) { + sl.m_data = static_cast<__impl const*>(pSl); + } return sl; }