Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix building with UBSan on Clang 20+

nikitalita11b0d0e71838
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index f3584cb8ac1..48f16f4fd4d 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -178,7 +178,7 @@ def configure(env: "SConsEnvironment"):
"-fsanitize=undefined,shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr,pointer-overflow,builtin"
]
)
- env.Append(LINKFLAGS=["-fsanitize=undefined"])
+ env.Append(LINKFLAGS=["-fsanitize=undefined,vptr"])
if env["use_llvm"]:
env.Append(
CCFLAGS=[
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index e6f757dce73..aa687ae925b 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -209,7 +209,7 @@ def configure(env: "SConsEnvironment"):
"-fsanitize=undefined,shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr,pointer-overflow,builtin"
]
)
- env.Append(LINKFLAGS=["-fsanitize=undefined"])
+ env.Append(LINKFLAGS=["-fsanitize=undefined,vptr"])
env.Append(CCFLAGS=["-fsanitize=nullability-return,nullability-arg,function,nullability-assign"])
if env["use_asan"]: