behaviour-tree-test/core/math
HP van Braam 240f510fa7 Core ubsan fixes
This fixes UBSAN errors reported by running our testsuite, importing the
TPS demo, and running the TPS demo. I have tried, wherever possible, to
fix issues related to reported issues but not directly reported by UBSAN
because thse code paths just happened to not have been exercised in
these cases.

These fixes apply only to errors reported, and caused by, core/

The following things have been changed:

* Make sure there are no implicit sign changing casts in core.
* Explicitly type enums that are part of a public API such that users of
  the API cannot pass in wrongly-sized values leading to potential stack
  corruption.
* Ensure that memcpy is never called with invalid or null pointers as
  this is undefined behavior, and when the engine is built with
  optimizations turned on leads to memory corruption and hard to debug
  crashes.
* Replace enum values only used as static values with constexpr static
  const values instead. This has no runtime overhead. This makes it so
  that the size of the enums is explicit.
* Make sure that nan and inf is handled consistently in String.
* Implement a _to_int template to ensure that all of the paths use the
  same algorhithm, and correct the negative integer case.
* Changed the way the json serializer precision work, and added tests to
  verify the new behavior. The behavior doesn't quite match master in
  particulary for negative doubles as the original code tried to cast -inf
  to an int. This then led to negative doubles losing all but one of
  their decimal points when serializing. Behavior in GDScript remains
  unchanged.
2024-12-18 14:31:12 +01:00
..
a_star.compat.inc add partial path return option for astar 2024-04-03 22:27:33 -07:00
a_star.cpp Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
a_star.h Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
a_star_grid_2d.compat.inc add partial path return option for astar 2024-04-03 22:27:33 -07:00
a_star_grid_2d.cpp fix astar partial path destination can be solid/disabled 2024-09-12 20:09:41 -07:00
a_star_grid_2d.h fix astar partial path destination can be solid/disabled 2024-09-12 20:09:41 -07:00
aabb.cpp Fix AABB Ray intersection - return inside 2024-05-09 20:41:19 +01:00
aabb.h Simplify and fix Rect2/AABB get_support function 2024-08-19 23:55:31 -07:00
audio_frame.h Fix member names of AudioFrame to match extension 2024-02-13 15:37:09 +01:00
basis.cpp Fix incorrect name of Basis global scale getter 2024-04-16 04:26:52 -07:00
basis.h Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
bvh.h Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
bvh_abb.h Fix some uses of float and real_t in core/math 2024-03-29 16:44:12 -07:00
bvh_cull.inc Merge pull request #57630 from lawnjelly/bvh4_templated_checks 2022-03-04 23:29:38 +01:00
bvh_debug.inc Fix some uses of float and real_t in core/math 2024-03-29 16:44:12 -07:00
bvh_integrity.inc
bvh_logic.inc Style: Add 19.1.0 LLVM options to .clang-format 2024-11-22 09:24:32 -06:00
bvh_misc.inc Style: Add 19.1.0 LLVM options to .clang-format 2024-11-22 09:24:32 -06:00
bvh_pair.inc Core ubsan fixes 2024-12-18 14:31:12 +01:00
bvh_public.inc Fixup BVH debugging statements 2022-07-25 18:21:53 +02:00
bvh_refit.inc Fix not refitting upward from leaf nodes. 2023-09-28 20:27:51 +08:00
bvh_split.inc Fix some uses of float and real_t in core/math 2024-03-29 16:44:12 -07:00
bvh_structs.inc Style: Add 19.1.0 LLVM options to .clang-format 2024-11-22 09:24:32 -06:00
bvh_tree.h Core ubsan fixes 2024-12-18 14:31:12 +01:00
color.cpp Optimize Color::find_named_color() 2024-05-23 15:19:19 +03:00
color.h Core ubsan fixes 2024-12-18 14:31:12 +01:00
color_names.inc Optimize Color::find_named_color() 2024-05-23 15:19:19 +03:00
convex_hull.cpp [Codestyle] Merge identical code piece. 2024-12-11 00:48:00 +08:00
convex_hull.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
delaunay_2d.h [Core] Codestyle improvements to math types 2024-03-04 18:17:10 +01:00
delaunay_3d.h [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
disjoint_set.h Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
dynamic_bvh.cpp Fix various typos with codespell 2023-02-01 08:45:41 +01:00
dynamic_bvh.h Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
expression.cpp Core: Fix JSON.{from,to}_native() issues 2024-11-29 12:43:06 +03:00
expression.h Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
face3.cpp Cleanup unused engine code v2 2023-01-19 13:02:18 +01:00
face3.h Core: Replace _NO_DISCARD_ macro with attribute 2024-04-12 16:40:01 -05:00
geometry_2d.cpp Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
geometry_2d.h Expose Geometry2D.bresenham_line() method 2024-10-25 10:27:55 +03:00
geometry_3d.cpp Pre-commit: Update to clang-format 17.0.6 and black 24.2.0 2024-02-28 14:25:35 +01:00
geometry_3d.h Fix some uses of float and real_t in core/math 2024-03-29 16:44:12 -07:00
math_defs.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
math_fieldwise.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
math_fieldwise.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
math_funcs.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
math_funcs.h Add modf function and fix snap behavior 2024-08-30 17:49:57 +03:00
plane.cpp Allow setting negative WorldBoundaryShape2D.distance through the editor 2023-06-14 14:54:00 +02:00
plane.h Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
projection.cpp Fix stringification of Projection 2024-11-25 21:10:32 +01:00
projection.h Core: Replace _NO_DISCARD_ macro with attribute 2024-04-12 16:40:01 -05:00
quaternion.cpp [Core] Codestyle improvements to math types 2024-03-04 18:17:10 +01:00
quaternion.h Core: Replace _NO_DISCARD_ macro with attribute 2024-04-12 16:40:01 -05:00
quick_hull.cpp [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
quick_hull.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
random_number_generator.cpp Add RandomNumberGenerator::rand_weighted method 2024-02-29 13:29:53 +01:00
random_number_generator.h Fix RandomNumberGenerator::rand_weighted return type 2024-03-02 20:56:01 -06:00
random_pcg.cpp Core ubsan fixes 2024-12-18 14:31:12 +01:00
random_pcg.h Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
rect2.cpp Always add decimal when printing float 2024-10-23 15:00:21 +02:00
rect2.h Simplify and fix Rect2/AABB get_support function 2024-08-19 23:55:31 -07:00
rect2i.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
rect2i.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
static_raycaster.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
static_raycaster.h Fix builtin_embree=no build linking the wrong version of Embree 2024-05-08 00:40:45 +02:00
transform_2d.cpp [Core] Codestyle improvements to math types 2024-03-04 18:17:10 +01:00
transform_2d.h Style: Add WARNING: as new comment admonition 2024-09-25 09:44:42 -05:00
transform_3d.cpp [Core] Codestyle improvements to math types 2024-03-04 18:17:10 +01:00
transform_3d.h Core: Replace _NO_DISCARD_ macro with attribute 2024-04-12 16:40:01 -05:00
transform_interpolator.cpp Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
transform_interpolator.h Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
triangle_mesh.cpp [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
triangle_mesh.h Cleanup unused engine code v2 2023-01-19 13:02:18 +01:00
triangulate.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
triangulate.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
vector2.cpp Always add decimal when printing float 2024-10-23 15:00:21 +02:00
vector2.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00
vector2i.cpp [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
vector2i.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00
vector3.cpp Always add decimal when printing float 2024-10-23 15:00:21 +02:00
vector3.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00
vector3i.cpp [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
vector3i.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00
vector4.cpp Fix stringification of Vector4 2024-11-22 21:44:30 +01:00
vector4.h Rename Vector4.components -> coord 2024-09-26 14:02:00 +02:00
vector4i.cpp [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
vector4i.h Merge pull request #90582 from Repiteo/core/remove-macro-_NO_DISCARD_ 2024-06-25 10:01:39 +02:00