brintos

brintos / llvm-project-archived public Read only

0
0
Text · 384 B · 92a587d Raw
16 lines · c
1// RUN: %clang_cc1 -fsyntax-only %s -Weverything2 3void free(void *);4typedef void (*set_free_func)(void *);5struct Method {6  int nparams;7  int *param;8};9void selelem_free_method(struct Method* method, void* data) {10    set_free_func free_func = 0;11    for (int i = 0; i < method->nparams; ++i)12        free(&method->param[i]);13    if (data && free_func)14        free_func(data);15}16