Be explicit in a uint->QChar conversion
And check that the result fits. Change-Id: Iaee1085315559bdffea9400b94b29869621ab7ff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d0a4084cbf
commit
dcbc8f16d0
@ -1063,7 +1063,9 @@ char *QUtf32::convertFromUnicode(char *out, QStringView in, QStringConverter::St
|
|||||||
QChar ch;
|
QChar ch;
|
||||||
uint ucs4;
|
uint ucs4;
|
||||||
if (state->remainingChars == 1) {
|
if (state->remainingChars == 1) {
|
||||||
ch = state->state_data[Data];
|
auto character = state->state_data[Data];
|
||||||
|
Q_ASSERT(character <= 0xFFFF);
|
||||||
|
ch = QChar(character);
|
||||||
// this is ugly, but shortcuts a whole lot of logic that would otherwise be required
|
// this is ugly, but shortcuts a whole lot of logic that would otherwise be required
|
||||||
state->remainingChars = 0;
|
state->remainingChars = 0;
|
||||||
goto decode_surrogate;
|
goto decode_surrogate;
|
||||||
|
Loading…
Reference in New Issue
Block a user