Skip to content

Commit

Permalink
Fix String::__boot when smart strings are disabled (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk authored Feb 11, 2025
1 parent aa01cc6 commit dd050c0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,7 @@ void String::__boot()
{
#ifdef HX_SMART_STRINGS
if (c>127)
#endif
{
char16_t buf[20];
buf[0] = c;
Expand All @@ -2386,8 +2387,8 @@ void String::__boot()
sConstStrings[c].__w = w;
fixHashPerm16(sConstStrings[c]);
}
#ifdef HX_SMART_STRINGS
else
#endif
{
char buf[20];
int utf8Len = UTF8Bytes(c);
Expand All @@ -2397,6 +2398,7 @@ void String::__boot()
sConstStrings[c].__s = (char *)InternalCreateConstBuffer(buf,utf8Len+1,true);
sConstStrings[c].length = utf8Len;
}
#endif
}

sConstEmptyString.mPtr = new (hx::NewObjConst)StringData(emptyString);
Expand All @@ -2405,8 +2407,3 @@ void String::__boot()
&CreateEmptyString, &CreateString, 0, 0, 0
);
}





0 comments on commit dd050c0

Please sign in to comment.