aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/pr101837.c
blob: f99374df6048056fa4bf3288126c883f66433760 (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-additional-options "-O3 -fsanitize=undefined" } */

void memory_exhausted();
void memcheck(void *ptr) {
  if (ptr) /* { dg-warning "leak" } */
    memory_exhausted();
}

int emalloc(int size) { memcheck(__builtin_malloc(size)); } /* { dg-message "allocated here" } */
int main() { int max_envvar_len = emalloc(max_envvar_len + 1); } /* { dg-message "use of uninitialized value 'max_envvar_len'" } */