https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63854
--- Comment #24 from dmalcolm at gcc dot gnu.org --- Author: dmalcolm Date: Mon Dec 1 17:40:03 2014 New Revision: 218234 URL: https://gcc.gnu.org/viewcvs?rev=218234&root=gcc&view=rev Log: PR jit/63854: Fix leaks in toyvm.c gcc/jit/ChangeLog: PR jit/63854 * docs/examples/tut04-toyvm/toyvm.c (toyvm_compiled_function): New typedef. (toyvm_compiled_func) Rename to... (toyvm_compiled_code) ...this. (struct toyvm_compiled_function): New struct. (toyvm_function_compile): Return a toyvm_compiled_function * rather than a toyvm_compiled_func, so that the caller can fully clean things up. Free "funcname". (test_script): Update for change to toyvm_function_compile. Clean up the toyvm_compiled_function. (main): Likewise. (docs/intro/tutorial04.rst): Update to reflect the above changes, and to better spell out the lifetime of the compiled code. Modified: trunk/gcc/jit/ChangeLog trunk/gcc/jit/docs/examples/tut04-toyvm/toyvm.c trunk/gcc/jit/docs/intro/tutorial04.rst