Refer to union members in initializers

These two functions are the primitive pseudo-constructors for the struct
fields in the union; as such, it does not make sense for them to use the
checked accessors.
This commit is contained in:
Steven Dee (Jōshin) 2024-06-19 08:19:11 -07:00
parent cc2e97ed20
commit 6eabf197e2
No known key found for this signature in database

View file

@ -332,16 +332,16 @@ class string
{ {
if (size > __::sso_max) if (size > __::sso_max)
__builtin_trap(); __builtin_trap();
*(blob + __::sso_max) = (__::sso_max - size); __s.rem = __::sso_max - size;
} }
void set_big_string(char* const p, const size_t n, const size_t c2) noexcept void set_big_string(char* const p, const size_t n, const size_t c2) noexcept
{ {
if (c2 > __::big_mask) if (c2 > __::big_mask)
__builtin_trap(); __builtin_trap();
*(char**)blob = p; __b.p = p;
*(((size_t*)blob) + 1) = n; __b.n = n;
*(((size_t*)blob) + 2) = c2 | ~__::big_mask; __b.c = c2 | ~__::big_mask;
} }
__::small_string* small() noexcept __::small_string* small() noexcept