[all-commits] [llvm/llvm-project] 73738f: Guard against self-assignment in InputArgList

Andy Kaylor via All-commits all-commits at lists.llvm.org
Thu Aug 24 14:45:23 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73738fa504bba4993db70c0ecac693d2fc72e171
      https://github.com/llvm/llvm-project/commit/73738fa504bba4993db70c0ecac693d2fc72e171
  Author: Andy Kaylor <andrew.kaylor at intel.com>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    M llvm/include/llvm/Option/ArgList.h
    M llvm/unittests/Option/OptionParsingTest.cpp

  Log Message:
  -----------
  Guard against self-assignment in InputArgList

The InputArgList move assignment operator releases memory before copying
fields, but it doesn't check against self-assignment. I haven't seen the
self-assignment happen, but it doesn't look safe.

Differential Revision: https://reviews.llvm.org/D158134




More information about the All-commits mailing list