[2/4] ir: Don't cache internal name of non-canonicalized function types

Message ID 20240817120026.459568-2-dodji@redhat.com
State New
Headers
Series [1/4] ir: Improve legibility of set_member_function_is_virtual |

Commit Message

Dodji Seketeli Aug. 17, 2024, noon UTC
  When a function type is not yet canonicalized, do not cache its name,
otherwise, the name can capture the state of the function in a too
early state.

	* src/abg-ir.cc (function_type::get_cached_name): Do not cache
	internal name for non-canonicalized function types.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-ir.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index bc23254a..873f3750 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -21633,9 +21633,8 @@  function_type::get_cached_name(bool internal) const
 	}
       else
 	{
-	  if (priv_->temp_internal_cached_name_.empty())
-	    priv_->temp_internal_cached_name_ =
-	      get_function_type_name(this, /*internal=*/true);
+	  priv_->temp_internal_cached_name_ =
+	    get_function_type_name(this, /*internal=*/true);
 	  return priv_->temp_internal_cached_name_;
 	}
     }