Debian Codegraph @

crt/aws-c-common/verification/cbmc/stubs/memmove_override_no_op.c

raw symbols SCIP
1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #undef memmove
7
8 #include <proof_helpers/nondet.h>
9 #include <stdint.h>
10
11 /**
12 * Override the version of memmove used by CBMC.
13 */
14 void *memmove_impl(void *dest, const void *src, size_t n) {
15 if (n > 0) {
16 (void)*(char *)dest; /* check that the memory is accessible */
17 (void)*(const char *)src; /* check that the memory is accessible */
18 (void)*(((unsigned char *)dest) + n - 1); /* check that the memory is accessible */
19 (void)*(((const unsigned char *)src) + n - 1); /* check that the memory is accessible */
20 }
21 return dest;
22 }
23
24 void *memmove(void *dest, const void *src, size_t n) {
25 return memmove_impl(dest, src, n);
26 }
27
28 void *__builtin___memmove_chk(void *dest, const void *src, size_t n, size_t size) {
29 (void)size;
30 return memmove_impl(dest, src, n);
31 }