Visitar URL original
C++: Remove uniqueness constraint from uuid by redsun82 · Pull Request #8390 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260612170853/https://github.com/github/codeql/pull/8390
Skip to content

C++: Remove uniqueness constraint from uuid#8390

Merged
rdmarsh2 merged 1 commit into
github:mainfrom
redsun82:remove-unique-from-uuid
Mar 11, 2022
Merged

C++: Remove uniqueness constraint from uuid#8390
rdmarsh2 merged 1 commit into
github:mainfrom
redsun82:remove-unique-from-uuid

Conversation

@redsun82

@redsun82 redsun82 commented Mar 10, 2022 •

Copy link
Copy Markdown
Contributor

Different class definitions can have the same uuid. This happens for
example when using #import <msxml6.dll>: there will be several C++
classes generated in msxml6.tlh which will share uuids with
extern "C" struct declarations in the system header msxml.h.

Notice that as far as the standard cpp QL library and queries go, we
expose getUuid() on UserType and we never try to invert it, so we
only rely on uniqueness of the id column in the usertype_uuid table,
not the uuid column.

Closes github/codeql-c-team#893

Different class definitions can have the same uuid. This happens for
example when using `#import <msxml6.dll>` there will be several C++
classes generated in `msxml6.tlh` which will share uuids with
`extern "C"` struct declarations in the system header `msxml.h`.

Notice that as far as the standard cpp QL library and queries go, we
expose `getUuid()` on `UserType` and we never try to invert it, so we
only rely on uniqueness of the `id` column in the `usertype_uuid` table,
not the `uuid` column.

Closes github/codeql-c-team#893
@redsun82 redsun82 requested a review from rdmarsh2 March 10, 2022 09:43
@redsun82 redsun82 requested a review from a team as a code owner March 10, 2022 09:43
@github-actions github-actions Bot added the C++ label Mar 10, 2022

@jketema jketema left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I also checked if we have any queries that use getUuid() but that doesn't seem to be the case. So this won't break anything from that perspective.

@rdmarsh2 rdmarsh2 merged commit 5c04516 into github:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants