You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
373 B
14 lines
373 B
5 years ago
|
Reported when an address pointing into the stack of the current
|
||
|
function will escape to its calling context. Such addresses will
|
||
|
become invalid by the time the function actually returns so are
|
||
|
potentially dangerous.
|
||
|
|
||
|
For example, directly returning a pointer to a local variable:
|
||
|
|
||
|
```C
|
||
|
int* foo() {
|
||
|
int x = 42;
|
||
|
return &x; // <-- warn here that "&x" will escape
|
||
|
}
|
||
|
```
|