mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
!7621 修改BitVector中关于位运算的告警
Merge pull request !7621 from liujia178/bitvector0523
This commit is contained in:
commit
031271c936
@ -57,7 +57,7 @@ JSTaggedValue ContainersBitVector::BitVectorConstructor(EcmaRuntimeCallInfo* arg
|
||||
|
||||
auto* newBitSetVector = new std::vector<std::bitset<JSAPIBitVector::BIT_SET_LENGTH>>();
|
||||
if (!length->IsZero()) {
|
||||
int32_t capacity = (length->GetInt() >> JSAPIBitVector::TAGGED_VALUE_BIT_SIZE) + 1;
|
||||
int32_t capacity = (length->GetInt() / JSAPIBitVector::BIT_SET_LENGTH) + 1;
|
||||
|
||||
std::bitset<JSAPIBitVector::BIT_SET_LENGTH> initBitSet;
|
||||
newBitSetVector->resize(capacity, initBitSet);
|
||||
|
@ -428,8 +428,8 @@ void JSAPIBitVector::Resize(JSThread* thread, const JSHandle<JSAPIBitVector>& bi
|
||||
[[maybe_unused]] ConcurrentApiScope<JSAPIBitVector, ModType::WRITE> scope(thread,
|
||||
bitVector.GetTaggedValue().GetTaggedObject());
|
||||
int length = bitVector->GetLength().GetInt();
|
||||
uint32_t elementsLength = ((length - 1) >> JSAPIBitVector::TAGGED_VALUE_BIT_SIZE) + 1;
|
||||
uint32_t newElementsLength = ((newSize - 1) >> JSAPIBitVector::TAGGED_VALUE_BIT_SIZE) + 1;
|
||||
uint32_t elementsLength = ((length - 1) / BIT_SET_LENGTH) + 1;
|
||||
uint32_t newElementsLength = ((newSize - 1) / BIT_SET_LENGTH) + 1;
|
||||
|
||||
JSHandle<JSNativePointer> np(thread, bitVector->GetNativePointer());
|
||||
auto elements = reinterpret_cast<std::vector<std::bitset<BIT_SET_LENGTH>>*>(np->GetExternalPointer());
|
||||
|
Loading…
Reference in New Issue
Block a user