Skip to content

libproc_macro: fix literal drop#2147

Merged
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
P-E-P:libproc_macro_fix_literal_drop
Apr 21, 2023
Merged

libproc_macro: fix literal drop#2147
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
P-E-P:libproc_macro_fix_literal_drop

Conversation

@P-E-P

@P-E-P P-E-P commented Apr 21, 2023

Copy link
Copy Markdown
Member

Needs #2120

Fixes #2146

@P-E-P P-E-P force-pushed the libproc_macro_fix_literal_drop branch from 9556778 to 095efae Compare April 21, 2023 12:50

@CohenArthur CohenArthur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM :)

Fix drop function by changing the delete operator to delete[] in order
to avoid undefined behaviors.

ChangeLog:

	* libgrust/libproc_macro/literal.cc (Literal::drop): Change
	delete operator to delete[].

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
@P-E-P P-E-P force-pushed the libproc_macro_fix_literal_drop branch from 095efae to 50de561 Compare April 21, 2023 14:02
@P-E-P P-E-P marked this pull request as ready for review April 21, 2023 14:03
@CohenArthur CohenArthur enabled auto-merge April 21, 2023 14:08
@CohenArthur CohenArthur added this pull request to the merge queue Apr 21, 2023
Merged via the queue into Rust-GCC:master with commit aa108c2 Apr 21, 2023
@P-E-P P-E-P deleted the libproc_macro_fix_literal_drop branch November 21, 2023 11:36
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.

Literal drop function may corrupt heap

2 participants