Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix String::__boot when smart strings are disabled #1192

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
}