[PATCH] Fix the argument index error of __builtin___memccpy_chk
jahanian
fjahanian at apple.com
Tue Sep 23 16:12:26 PDT 2014
Ok. But please provide a test case. See builtin-object-size.c for some samples.
- Fariborz
On Sep 23, 2014, at 4:03 PM, Steven Wu <stevenwu at apple.com> wrote:
> Fix an assertion failure in CheckBuiltinFunctionCall.
> memccpy_chk should have source and dest size at arg 3 and 4.
>
> ---
> lib/Sema/SemaChecking.cpp | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
> index 7462869..5ea862c 100644
> --- a/lib/Sema/SemaChecking.cpp
> +++ b/lib/Sema/SemaChecking.cpp
> @@ -365,7 +365,6 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
> // check secure string manipulation functions where overflows
> // are detectable at compile time
> case Builtin::BI__builtin___memcpy_chk:
> - case Builtin::BI__builtin___memccpy_chk:
> case Builtin::BI__builtin___memmove_chk:
> case Builtin::BI__builtin___memset_chk:
> case Builtin::BI__builtin___strlcat_chk:
> @@ -375,6 +374,9 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
> case Builtin::BI__builtin___stpncpy_chk:
> SemaBuiltinMemChkCall(*this, FDecl, TheCall, 2, 3);
> break;
> + case Builtin::BI__builtin___memccpy_chk:
> + SemaBuiltinMemChkCall(*this, FDecl, TheCall, 3, 4);
> + break;
> case Builtin::BI__builtin___snprintf_chk:
> case Builtin::BI__builtin___vsnprintf_chk:
> SemaBuiltinMemChkCall(*this, FDecl, TheCall, 1, 3);
>
> <memccpy.patch>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140923/f9f8f1b8/attachment.html>
More information about the cfe-commits
mailing list