!4319 Modifying Code Alarms

Merge pull request !4319 from 韩靖/master
This commit is contained in:
openharmony_ci 2023-06-27 09:39:33 +00:00 committed by Gitee
commit d11654e229
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 12 additions and 11 deletions

View File

@ -105,7 +105,8 @@ HWTEST_F_L0(NumberHelperTest, DoubleToString_001)
radix = 5;
resultStr = factory->NewFromASCII("-1104332401304422434310320000");
JSHandle<EcmaString> handleEcmaStr5(thread, NumberHelper::DoubleToString(thread, static_cast<double>(-9223372036854775807), radix));
JSHandle<EcmaString> handleEcmaStr5(thread,
NumberHelper::DoubleToString(thread, static_cast<double>(-9223372036854775807), radix));
EXPECT_EQ(EcmaStringAccessor::Compare(instance, handleEcmaStr5, resultStr), 0);
radix = 6;

View File

@ -480,7 +480,7 @@ void JSObject::GetAllElementKeysByFilter(JSThread *thread,
JSHandle<TaggedArray> elements(thread, obj->GetElements());
JSHandle<JSTaggedValue> objValue(obj);
if (!elements->IsDictionaryMode()) {
uint32_t elementsLen = elements->GetLength();
for (uint32_t i = 0; i < elementsLen; ++i) {
@ -1266,7 +1266,7 @@ JSHandle<TaggedArray> JSObject::GetAllPropertyKeys(JSThread *thread, const JSHan
bool isInculdePrototypes = (filter & NATIVE_KEY_INCLUDE_PROTOTYPES);
JSMutableHandle<JSObject> currentObj(thread, obj);
JSMutableHandle<JSTaggedValue> currentObjValue(thread, currentObj);
uint32_t curObjNumberOfElements = currentObj->GetNumberOfElements();
uint32_t curObjNumberOfKeys = currentObj->GetNumberOfKeys();
uint32_t curObjectKeysLength = curObjNumberOfElements + curObjNumberOfKeys;
@ -1274,7 +1274,7 @@ JSHandle<TaggedArray> JSObject::GetAllPropertyKeys(JSThread *thread, const JSHan
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
JSMutableHandle<TaggedArray> retArray(thread, factory->NewTaggedArray(retArraylength));
uint32_t retArrayEffectivelength = 0;
do {
curObjNumberOfElements = currentObj->GetNumberOfElements();
curObjNumberOfKeys = currentObj->GetNumberOfKeys();
@ -1512,13 +1512,14 @@ bool JSObject::TestIntegrityLevel(JSThread *thread, const JSHandle<JSObject> &ob
handleKey.Update(taggedKey);
PropertyDescriptor currentDesc(thread);
bool curDescStatus =
JSTaggedValue::GetOwnProperty(thread,JSHandle<JSTaggedValue>(obj), handleKey, currentDesc);
JSTaggedValue::GetOwnProperty(thread, JSHandle<JSTaggedValue>(obj), handleKey, currentDesc);
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
if (curDescStatus) {
if (currentDesc.IsConfigurable()) {
return false;
}
if (level == IntegrityLevel::FROZEN && currentDesc.IsDataDescriptor() && currentDesc.IsWritable()) {
if (level == IntegrityLevel::FROZEN &&
currentDesc.IsDataDescriptor() && currentDesc.IsWritable()) {
return false;
}
}

View File

@ -1061,7 +1061,6 @@ void PGORecordDetailInfos::ProcessToText(std::ofstream &stream) const
} else {
profilerString += BLOCK_SEPARATOR + SPACE;
}
isFirst = false;
profilerString += PGOHClassLayoutDescInner::GetTypeString(layoutInfoIter);
}
if (!isFirst) {

View File

@ -320,7 +320,7 @@ public:
return;
}
}
if (count < 4) {
if (count < 4) { // 4 : Class type
type_[count] = type;
count_++;
} else {

View File

@ -576,8 +576,8 @@ public:
int32_t idxMax = static_cast<int32_t>(rangeCount - 1);
int32_t idx = 0;
uint32_t low = 0;
uint32_t high =
byteCode.GetU16(currentPc + RANGE32_HEAD_OFFSET + idxMax * RANGE32_MAX_HALF_OFFSET + RANGE32_OFFSET);
uint32_t high = byteCode.GetU16(currentPc + RANGE32_HEAD_OFFSET +
static_cast<size_t>(idxMax) * RANGE32_MAX_HALF_OFFSET + RANGE32_OFFSET);
if (nowChar <= high) {
while (idxMin <= idxMax) {
idx = (idxMin + idxMax) / RANGE32_OFFSET;
@ -597,7 +597,7 @@ public:
}
return isFound;
}
uint32_t GetCurrentPC() const
{
return currentPc_;