Skip to content

[wasm][coreCLR] fix ASAN/ASSERTIONS issues #119997

@pavelsavara

Description

@pavelsavara

I compiled coreCLR for WASM with maybe? ASAN? flags and started getting "memory out of bounds".
I see memset or memcpy validating target pointer even when size is zero.

For example here when prevCapacity is 0 then from->ppOutBBs is -1.

memcpy(newa, from->ppOutBBs, from->outCount * sizeof(InterpBasicBlock*));

In another place cFields is 0 and bmtMFDescs->ppFieldDescList is -1

bmtMFDescs->ppFieldDescList = new (GetStackingAllocator()) FieldDesc*[bmtMetaData->cFields];
ZeroMemory(bmtMFDescs->ppFieldDescList, bmtMetaData->cFields * sizeof(FieldDesc *));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions