From 28ebe93b77437ade49fbd1321a06e4b1ebf8b473 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/ox/src/ox/std/source_location.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/ox/src/ox/std/source_location.hpp b/deps/ox/src/ox/std/source_location.hpp index 66195e09..54bff14e 100644 --- a/deps/ox/src/ox/std/source_location.hpp +++ b/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; }