mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
gccrs: libproc_macro: Fix literal drop function
Fix drop function by changing the delete operator to delete[] in order to avoid undefined behaviors. libgrust/ChangeLog: * libproc_macro/literal.cc (Literal::drop): Change delete operator to delete[]. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
parent
98b779a83c
commit
2698707419
@ -32,11 +32,11 @@ Literal::drop (Literal *lit)
|
||||
switch (lit->tag)
|
||||
{
|
||||
case STRING:
|
||||
delete lit->payload.string_payload.data;
|
||||
delete[] lit->payload.string_payload.data;
|
||||
lit->payload.string_payload.len = 0;
|
||||
break;
|
||||
case BYTE_STRING:
|
||||
delete lit->payload.byte_string_payload.data;
|
||||
delete[] lit->payload.byte_string_payload.data;
|
||||
lit->payload.byte_string_payload.size = 0;
|
||||
break;
|
||||
case CHAR:
|
||||
|
Loading…
Reference in New Issue
Block a user