Skip to content

Commit aac5be9

Browse files
authored
Update error-memcpy-param-overlap.md
1 parent 1bad6b6 commit aac5be9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/sanitizers/error-memcpy-param-overlap.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ int main(int argc, char **argv) {
3535
To build and test this example, run these commands in a Visual Studio 2019 version 16.9 or later [developer command prompt](../build/building-on-the-command-line.md#developer_command_prompt_shortcuts):
3636
3737
```cmd
38-
cl example1.cpp /fsanitize=address /Zi
38+
cl example1.cpp /fsanitize=address /Zi /Oi
3939
devenv /debugexe example1.exe
4040
```
4141

42+
The [/Oi flag](../../build/reference/oi-generate-intrinsic-functions) tells the compiler to treat memcpy and memmove as intrinsic functions. This is necessary because some versions of the standard library implement memcpy and memmove in the same way and ASAN only detects bad code that is actually executed.
43+
4244
### Resulting error
4345

4446
:::image type="content" source="media/memcpy-param-overlap-example-1.png" alt-text="Screenshot of debugger displaying memcpy-param-overlap error in example 1.":::

0 commit comments

Comments
 (0)