From 3f0147e161df4725ff15fbb731f4f727afcc229f Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Thu, 29 Oct 2009 23:34:20 +0000 Subject: [PATCH] Fix one more bug with __builtin_object_size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85538 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ExprConstant.cpp | 2 +- test/CodeGen/object-size.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 9bf5215634..6ddeba99a7 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -189,7 +189,7 @@ public: { return Visit(E->getChosenSubExpr(Info.Ctx)); } bool VisitCastExpr(CastExpr *E) { return Visit(E->getSubExpr()); } bool VisitBinAssign(BinaryOperator *E) { return true; } - bool VisitCompoundAssign(BinaryOperator *E) { return true; } + bool VisitCompoundAssignOperator(BinaryOperator *E) { return true; } bool VisitBinaryOperator(BinaryOperator *E) { return Visit(E->getLHS()) || Visit(E->getRHS()); } bool VisitUnaryPreInc(UnaryOperator *E) { return true; } diff --git a/test/CodeGen/object-size.c b/test/CodeGen/object-size.c index 27e24ac120..db6d948d83 100644 --- a/test/CodeGen/object-size.c +++ b/test/CodeGen/object-size.c @@ -118,3 +118,9 @@ void test15() { // CHECK: call ___inline_strcpy_chk strcpy(gp--, "Hi there"); } + +void test16() { + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy(gp += 1, "Hi there"); +} -- 2.40.0