Skip to content

Conversation

@RuslanKutdusov
Copy link

Hi, was working on some project that uses DirectX-Headers, launched it with Asan and catched out of bound reads. This pull request fixes it

return E_INVALIDARG;
}

static const UINT SizesOfSubobject[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written, this will end up in the data segment of every .obj file which is a bit of duplication.

@jenatali Would you prefer we use something like extern const __declspec(selectany) UINT g_SizeOfSubobject[] here -or- create a .cpp file that hosts the one copy of it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like either of those approaches. I'm honestly not a huge fan of using a data table here that's separate from the switch. I don't see the point of it.

If ASAN says there's a bug let's just fix the bug, I assume it's a copy/paste bug, we don't need a paradigm shift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants