[all-commits] [llvm/llvm-project] 25909b: Fix pointer to reference type (#113596)

jeffreytan81 via All-commits all-commits at lists.llvm.org
Thu Oct 24 17:13:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25909b811a7ddc983d042b15cb54ec271a673d63
      https://github.com/llvm/llvm-project/commit/25909b811a7ddc983d042b15cb54ec271a673d63
  Author: jeffreytan81 <jeffreytan at meta.com>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

  Changed paths:
    M lldb/source/Core/ValueObject.cpp
    M lldb/test/API/lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py
    M lldb/test/API/lang/cpp/dereferencing_references/main.cpp

  Log Message:
  -----------
  Fix pointer to reference type (#113596)

We have got customer reporting "v &obj" and "p &obj" reporting different
results.
Turns out it only happens for obj that is itself a reference type which
"v &obj" reports the address of the reference itself instead of the
target object the reference points to. This diverged from C++ semantics.

This PR fixes this issue by returning the address of the dereferenced
object if it is reference type.

A new test is added which fails before.

Co-authored-by: jeffreytan81 <jeffreytan at fb.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list