[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed May 22 12:47:17 UTC 2019


 compilerplugins/clang/empty.cxx                |    2 +-
 compilerplugins/clang/expressionalwayszero.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9c346feb33bddfe9b52a8a4cbc70e81193ce3c95
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed May 22 09:37:53 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed May 22 14:46:34 2019 +0200

    Don't try to evaluate value of value-dependent Expr
    
    ...which causes asserts to fire since <https://github.com/llvm/llvm-project/
    commit/04323c24a1ac9464471331d9f6499d3cb95d1ccd> "Added an assertion to constant
    evaluation enty points that prohibits …"
    
    Change-Id: Iafbf1cea85d15a38a71275d4cea8303bab500f6a
    Reviewed-on: https://gerrit.libreoffice.org/72723
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/empty.cxx b/compilerplugins/clang/empty.cxx
index 4d48ca620087..5cf5a023e54c 100644
--- a/compilerplugins/clang/empty.cxx
+++ b/compilerplugins/clang/empty.cxx
@@ -100,7 +100,7 @@ private:
             return;
         }
         APSInt val;
-        if (!rhs->isIntegerConstantExpr(val, compiler.getASTContext()))
+        if (rhs->isValueDependent() || !rhs->isIntegerConstantExpr(val, compiler.getASTContext()))
         {
             return;
         }
diff --git a/compilerplugins/clang/expressionalwayszero.cxx b/compilerplugins/clang/expressionalwayszero.cxx
index c3bc0bb0730f..067aa9cc6dbd 100644
--- a/compilerplugins/clang/expressionalwayszero.cxx
+++ b/compilerplugins/clang/expressionalwayszero.cxx
@@ -135,7 +135,7 @@ std::unique_ptr<APSInt> ExpressionAlwaysZero::getExprValue(Expr const * expr)
         return std::unique_ptr<APSInt>();
     }
     APSInt x1;
-    if (compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
+    if (!expr->isValueDependent() && compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
         return std::unique_ptr<APSInt>(new APSInt(x1));
     return std::unique_ptr<APSInt>();
 }


More information about the Libreoffice-commits mailing list