[all-commits] [llvm/llvm-project] a05392: [AST] Fix a constexpr-evaluator crash on error-dep...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Dec 10 01:12:39 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a0539298540e49cb734c7b82f93572ab46bf9b00
      https://github.com/llvm/llvm-project/commit/a0539298540e49cb734c7b82f93572ab46bf9b00
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constexpr-function-recovery-crash.cpp

  Log Message:
  -----------
  [AST] Fix a constexpr-evaluator crash on error-dependent returnstmt.

When the evaluator encounters an error-dependent returnstmt, before this patch
it returned a ESR_Returned without setting the result, the callsides think this
is a successful execution, and try to access the Result which causes the crash.

The fix is to always return failed as we don't know the result of the
error-dependent return stmt.

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




More information about the All-commits mailing list