Modify code warning

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8UTG3

Signed-off-by: liushitong <liushitong@huawei.com>
This commit is contained in:
liushitong 2024-01-10 15:44:54 +08:00
parent 244e2fe1f7
commit e3ab474203
3 changed files with 5 additions and 5 deletions

View File

@ -770,12 +770,12 @@ public:
bool IsReceiverNoEqNewHolder(size_t index) const
{
return std::get<0>(types_[index]) != std::get<2>(types_[index]);
return std::get<0>(types_[index]) != std::get<2>(types_[index]); // 2 means 3rd object
}
bool IsHolderEqNewHolder(size_t index) const
{
return std::get<1>(types_[index]) == std::get<2>(types_[index]);
return std::get<1>(types_[index]) == std::get<2>(types_[index]); // 2 means 3rd object
}
GateRef GetValue() const

View File

@ -921,7 +921,7 @@ bool JSObject::SetPropertyForDataDescriptor(ObjectOperator *op, const JSHandle<J
if (hasReceiver || isInternalAccessor) {
return op->AddProperty(JSHandle<JSObject>(receiver), value, PropertyAttributes::Default());
} else if (op->IsFound() && receiver.GetTaggedValue() != op->GetHolder().GetTaggedValue()) {
return op->AddProperty(JSHandle<JSObject>(receiver), value, PropertyAttributes::Default());
return op->AddProperty(JSHandle<JSObject>(receiver), value, PropertyAttributes::Default());
} else {
return op->AddProperty(JSHandle<JSObject>(receiver), value, op->GetAttr());
}

View File

@ -385,7 +385,7 @@ public:
auto count = protoChain.size();
size_t size = sizeof(PGOProtoChainTemplate);
if (count != 0) {
size += sizeof(PGOProfileType) * (count - 1) * 2;
size += sizeof(PGOProfileType) * (count - 1) * 2; // 2 means mul by 2
}
auto result = reinterpret_cast<PGOProtoChainTemplate *>(malloc(size));
new (result) PGOProtoChainTemplate(size, count);
@ -410,7 +410,7 @@ public:
auto count = from->GetCount();
size_t size = sizeof(PGOProtoChainTemplate);
if (count != 0) {
size += sizeof(PGOProfileType) * (count - 1) * 2;
size += sizeof(PGOProfileType) * (count - 1) * 2; // 2 means mul by 2
}
auto result = reinterpret_cast<PGOProtoChainTemplate *>(malloc(size));
new (result) PGOProtoChainTemplate(size, count);