mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
[Support/YAML] Properly fix unitialized variable warning by inserting a
'REPLACEMENT CHARACTER' (U+FFFD) when getAsInteger fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5c77bc29db
commit
60f3d92b2a
@ -1732,8 +1732,10 @@ StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue
|
|||||||
if (UnquotedValue.size() < 3)
|
if (UnquotedValue.size() < 3)
|
||||||
// TODO: Report error.
|
// TODO: Report error.
|
||||||
break;
|
break;
|
||||||
unsigned int UnicodeScalarValue = 0;
|
unsigned int UnicodeScalarValue;
|
||||||
UnquotedValue.substr(1, 2).getAsInteger(16, UnicodeScalarValue);
|
if (UnquotedValue.substr(1, 2).getAsInteger(16, UnicodeScalarValue))
|
||||||
|
// TODO: Report error.
|
||||||
|
UnicodeScalarValue = 0xFFFD;
|
||||||
encodeUTF8(UnicodeScalarValue, Storage);
|
encodeUTF8(UnicodeScalarValue, Storage);
|
||||||
UnquotedValue = UnquotedValue.substr(2);
|
UnquotedValue = UnquotedValue.substr(2);
|
||||||
break;
|
break;
|
||||||
@ -1742,8 +1744,10 @@ StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue
|
|||||||
if (UnquotedValue.size() < 5)
|
if (UnquotedValue.size() < 5)
|
||||||
// TODO: Report error.
|
// TODO: Report error.
|
||||||
break;
|
break;
|
||||||
unsigned int UnicodeScalarValue = 0;
|
unsigned int UnicodeScalarValue;
|
||||||
UnquotedValue.substr(1, 4).getAsInteger(16, UnicodeScalarValue);
|
if (UnquotedValue.substr(1, 4).getAsInteger(16, UnicodeScalarValue))
|
||||||
|
// TODO: Report error.
|
||||||
|
UnicodeScalarValue = 0xFFFD;
|
||||||
encodeUTF8(UnicodeScalarValue, Storage);
|
encodeUTF8(UnicodeScalarValue, Storage);
|
||||||
UnquotedValue = UnquotedValue.substr(4);
|
UnquotedValue = UnquotedValue.substr(4);
|
||||||
break;
|
break;
|
||||||
@ -1752,8 +1756,10 @@ StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue
|
|||||||
if (UnquotedValue.size() < 9)
|
if (UnquotedValue.size() < 9)
|
||||||
// TODO: Report error.
|
// TODO: Report error.
|
||||||
break;
|
break;
|
||||||
unsigned int UnicodeScalarValue = 0;
|
unsigned int UnicodeScalarValue;
|
||||||
UnquotedValue.substr(1, 8).getAsInteger(16, UnicodeScalarValue);
|
if (UnquotedValue.substr(1, 8).getAsInteger(16, UnicodeScalarValue))
|
||||||
|
// TODO: Report error.
|
||||||
|
UnicodeScalarValue = 0xFFFD;
|
||||||
encodeUTF8(UnicodeScalarValue, Storage);
|
encodeUTF8(UnicodeScalarValue, Storage);
|
||||||
UnquotedValue = UnquotedValue.substr(8);
|
UnquotedValue = UnquotedValue.substr(8);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user