[all-commits] [llvm/llvm-project] f72e53: [clang][CompundLiteralExpr] Don't defer evaluation...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Tue Jul 8 07:01:01 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f72e53f35070140cbd6d4acdf7f8bc37f72d0445
      https://github.com/llvm/llvm-project/commit/f72e53f35070140cbd6d4acdf7f8bc37f72d0445
  Author: kadir çetinkaya <kadircet at google.com>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M clang/include/clang/AST/Expr.h
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ExprConstant.cpp
    A clang/test/AST/static-compound-literals-crash.cpp
    A clang/test/AST/static-compound-literals-reeval.cpp
    A clang/test/AST/static-compound-literals.cpp

  Log Message:
  -----------
  [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (#137163)

Previously we would defer evaluation of CLEs until LValue to RValue
conversions, which would result in creating values within wrong scope
and triggering use-after-frees.

This patch instead eagerly evaluates CLEs, within the scope requiring
them. This requires storing an extra pointer for CLE expressions with
static storage.

Fixes https://github.com/llvm/llvm-project/issues/137165



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