public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] ada: gcc-if: build proper String_Pointer for Get_External_Name
@ 2022-05-13 9:28 Alexandre Oliva
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-05-13 9:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b5dc4a24dad88c667423ea8ae5ba4f6661cf2244
commit b5dc4a24dad88c667423ea8ae5ba4f6661cf2244
Author: Alexandre Oliva <oliva@adacore.com>
Date: Fri May 13 04:29:10 2022 -0300
ada: gcc-if: build proper String_Pointer for Get_External_Name
The compiler is allowed to assume it can access String bounds, such as
the prefix passed to Get_External_Name, even in circumstances in which
the prefix is not going to be used and has_prefix is false, so, from
the C side, we have to build a proper String_Template for the
String_Pointer.
for gcc/ada/ChangeLog
* gcc-interface/decl.cc (is_cplusplus_method): Build proper
String for Get_External_Name.
Diff:
---
gcc/ada/gcc-interface/decl.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 56ad4998e22..28e1ab7ce81 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -4956,7 +4956,8 @@ is_cplusplus_method (Entity_Id gnat_entity)
'this' parameter is not encoded in the mangled name of a method. */
if (Is_Subprogram (gnat_entity) && Present (Interface_Name (gnat_entity)))
{
- String_Pointer sp = { NULL, NULL };
+ String_Template temp = { 0, 0 };
+ String_Pointer sp = { "", &temp };
Get_External_Name (gnat_entity, false, sp);
void *mem;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/aoliva/heads/testme)] ada: gcc-if: build proper String_Pointer for Get_External_Name
@ 2022-05-13 7:32 Alexandre Oliva
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-05-13 7:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:226353965185722fddeb7e63c92aa730e889ccd7
commit 226353965185722fddeb7e63c92aa730e889ccd7
Author: Alexandre Oliva <oliva@adacore.com>
Date: Fri May 13 04:29:10 2022 -0300
ada: gcc-if: build proper String_Pointer for Get_External_Name
The compiler is allowed to assume it can access String bounds, such as
the prefix passed to Get_External_Name, even in circumstances in which
the prefix is not going to be used and has_prefix is false, so, from
the C side, we have to build a proper String_Template for the
String_Pointer.
for gcc/ada/ChangeLog
* gcc-interface/decl.c (is_cplusplus_method): Build proper
String for Get_External_Name.
Diff:
---
gcc/ada/gcc-interface/decl.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 56ad4998e22..28e1ab7ce81 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -4956,7 +4956,8 @@ is_cplusplus_method (Entity_Id gnat_entity)
'this' parameter is not encoded in the mangled name of a method. */
if (Is_Subprogram (gnat_entity) && Present (Interface_Name (gnat_entity)))
{
- String_Pointer sp = { NULL, NULL };
+ String_Template temp = { 0, 0 };
+ String_Pointer sp = { "", &temp };
Get_External_Name (gnat_entity, false, sp);
void *mem;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-13 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 9:28 [gcc(refs/users/aoliva/heads/testme)] ada: gcc-if: build proper String_Pointer for Get_External_Name Alexandre Oliva
-- strict thread matches above, loose matches on Subject: below --
2022-05-13 7:32 Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).