Skip to content

闪退!当使用console.log("arr:",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); #111

@Cmduck

Description

@Cmduck

Cocos Creator version

3.8.7

System information

android,ios,windows

Issue description

`ValueArray &ValueArrayPool::get(uint32_t argc, bool &outNeedDelete) {
if (SE_UNLIKELY(_depth >= _pools.size())) {
outNeedDelete = true;
auto *ret = ccnew ValueArray();
ret->resize(argc);
return *ret;
}

outNeedDelete = false;
CC_ASSERT_LE(argc, MAX_ARGS);
auto &ret = _pools[_depth][argc];
CC_ASSERT(ret.size() == argc);
return ret;

}这段代码有问题当argc>MAX_ARGS的情况没有处理。复现代码如下:
console.log("arr:",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
实际业务使用代码如下:
const arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
console.log(arr);
`

Relevant error log output

No response

Steps to reproduce

console.log("arr:",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);

Minimal reproduction project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions