godot/core/string
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
..
char_range.inc Core: Update char_range.inc to Unicode 16 2024-10-21 14:54:19 -05:00
char_utils.h Core: Update char_range.inc to Unicode 16 2024-10-21 14:54:19 -05:00
fuzzy_search.cpp Add fuzzy string matching to quick open search 2024-10-28 11:24:36 -07:00
fuzzy_search.h Add fuzzy string matching to quick open search 2024-10-28 11:24:36 -07:00
locales.h
node_path.cpp Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
node_path.h
optimized_translation.cpp
optimized_translation.h
print_string.cpp Add support for 24-bit color escape sequences, simplify print_rich BBCode parsing. 2024-10-13 22:31:57 +03:00
print_string.h
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
string_buffer.h Core ubsan fixes 2024-12-18 14:31:12 +01:00
string_builder.cpp Optimize StringBuilder.as_string by constructing the string in-place and skipping unnecessary checks. 2024-12-12 01:35:02 +01:00
string_builder.h Optimize StringBuilder append for static strings, and as_string(). 2024-12-08 16:39:25 +01:00
string_name.cpp Move StringName != to the header file to make it inlineable. 2024-12-01 19:50:34 +01:00
string_name.h Move StringName != to the header file to make it inlineable. 2024-12-01 19:50:34 +01:00
translation_domain.cpp Merge pull request #98547 from timothyqiu/loaded-locales-set 2024-11-11 14:18:40 -06:00
translation_domain.h Move pseudolocalization into TranslationDomain 2024-09-21 18:28:12 +08:00
translation_po.cpp Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
translation_po.h Improve PR plural translation rules handling. 2024-06-18 19:04:00 +03:00
translation_server.compat.inc Expose standardize_locale add_default param publicly 2024-11-21 16:50:31 -07:00
translation_server.cpp Fix various typos and code style issues 2024-11-28 17:40:42 +01:00
translation_server.h Expose standardize_locale add_default param publicly 2024-11-21 16:50:31 -07:00
translation.cpp Make loading translations from threads safe 2024-11-22 09:44:07 +01:00
translation.h StringName: Fix empty hash 2024-09-09 13:30:02 -07:00
ucaps.h
ustring.cpp Core ubsan fixes 2024-12-18 14:31:12 +01:00
ustring.h Add move constructor and move assignment to CowData, String, Char16String, CharString and Vector. 2024-12-11 15:52:15 +01:00