[all-commits] [llvm/llvm-project] fb2c76: [clang][bytecode] Fix comparing pointers pointing ...

Timm Baeder via All-commits all-commits at lists.llvm.org
Sat Jul 5 10:43:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb2c7610e831646c5e01986306e8771730c937ff
      https://github.com/llvm/llvm-project/commit/fb2c7610e831646c5e01986306e8771730c937ff
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2025-07-05 (Sat, 05 Jul 2025)

  Changed paths:
    M clang/lib/AST/ByteCode/Interp.h
    M clang/lib/AST/ByteCode/Pointer.cpp
    M clang/lib/AST/ByteCode/Pointer.h
    M clang/test/AST/ByteCode/literals.cpp
    M clang/test/AST/ByteCode/new-delete.cpp

  Log Message:
  -----------
  [clang][bytecode] Fix comparing pointers pointing to base classes (#146285)

In the attached test case, one pointer points to the `Derived` class and
one to `Base`, but they should compare equal. They didn't because those
two bases are saved at different offsets in the block. Use
`computeOffsetForComparison` not just for unions and fix it to work in
the more general cases.



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