[all-commits] [llvm/llvm-project] d68aa3: [clang][Interp] Do r-to-l conversion immediately w...

Timm Baeder via All-commits all-commits at lists.llvm.org
Thu Feb 15 06:13:24 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d68aa303fe779a29a981d1d4166c45a128aa65d6
      https://github.com/llvm/llvm-project/commit/d68aa303fe779a29a981d1d4166c45a128aa65d6
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M clang/lib/AST/Interp/ByteCodeExprGen.cpp
    M clang/lib/AST/Interp/Context.cpp
    M clang/lib/AST/Interp/EvalEmitter.cpp
    M clang/lib/AST/Interp/EvalEmitter.h
    M clang/lib/AST/Interp/EvaluationResult.h
    M clang/test/AST/Interp/c.c
    M clang/test/Sema/warn-char-subscripts.c

  Log Message:
  -----------
  [clang][Interp] Do r-to-l conversion immediately when returning (#80662)

First, we need to register local constant variables in C, so we get the
same diagnostic behavior as the current interpeter.

Second, when returning an LValue (as a Pointer), which we eventually
convert to an RValue, we need to do the conversion immediately when
saving the Pointer in the EvaluationResult. Otherwise, we will possibly
deallocate the data before doing the conversion (which will look at the
Block*).




More information about the All-commits mailing list