We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 287048d commit 73488d8Copy full SHA for 73488d8
llvm/lib/IR/Constants.cpp
@@ -3135,11 +3135,14 @@ bool ConstantDataSequential::isUnicodeString() const {
3135
3136
StringRef RawDataValues = this->getRawDataValues();
3137
unsigned int NumElements = this->getNumElements();
3138
+ if (NumElements < sizeof(unsigned short))
3139
+ return false;
3140
+
3141
size_t Length = NumElements * sizeof(unsigned short);
3142
3143
if (RawDataValues[Length - 1] == 0 &&
3144
RawDataValues[Length - sizeof(unsigned short)] == 0) {
- for (unsigned int i = 0; i < Length - sizeof(unsigned short) - 1; ++i)
3145
+ for (size_t i = 0; i < Length - sizeof(unsigned short) - 1; ++i)
3146
if (RawDataValues[i] == 0 && RawDataValues[i + 1] == 0)
3147
return false;
3148
0 commit comments