Skip to content

Replace toString use #5558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 31, 2021
Merged

Replace toString use #5558

merged 4 commits into from
Mar 31, 2021

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Mar 29, 2021

Using toString in query logic is not good practice.

These kinds of changes can have subtle effects so I've run a diff query: https://lgtm.com/query/5866409770224514073/ .

I think the new results (beginning on page 3) are for calls to a 'non-allocating' new (see https://en.cppreference.com/w/cpp/memory/new/operator_new), that is nothrow not because it returns 0 on an allocation error, but because it doesn't have allocation errors. If someone can confirm this makes sense, I'll add an exclusion in the query for that version of new.

The lost results (on page 4) LGTM.

@geoffw0 geoffw0 added the C++ label Mar 29, 2021
@geoffw0 geoffw0 requested a review from a team as a code owner March 29, 2021 15:53
@geoffw0
Copy link
Contributor Author

geoffw0 commented Mar 31, 2021

@kevinbackhouse this is a small modification to a query we had been discussing. Can you spare a couple of minutes to review it? (if not I'll ask someone in the CPP team)

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

I haven't looked at the LGTM results yet. (But hopefully, I'll get a chance to later today 🤞.)

…ndHandlingMemoryAllocationErrors.ql

Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM!

@MathiasVP MathiasVP merged commit e9e93c0 into github:main Mar 31, 2021
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