[COMMITTED 130/141] gccrs: Fix canonical path parent resolution

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Mon Mar 24 12:45:53 GMT 2025


From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The algorithm was comparing using the wrong id, this lead to some
mangling errors as an erroneous parent was selected.

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.hxx: Fix the id comparison.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-forever-stack.hxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index 59142a4094c..90e0ceb9f81 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -686,7 +686,7 @@ ForeverStack<N>::to_canonical_path (NodeId id) const
 	  auto &link = kv.first;
 	  auto &child = kv.second;
 
-	  if (link.id == child.id)
+	  if (current.id == child.id)
 	    {
 	      outer_link = &link;
 	      break;
-- 
2.45.2



More information about the Gcc-rust mailing list