From 20955b2bfc97b906149af3b2327e2113baf5ff25 Mon Sep 17 00:00:00 2001 From: pcpa Date: Sun, 1 Mar 2015 11:38:41 -0300 Subject: [PATCH] Correct read of freed memory --- doc/body.texi | 12 ++++++------ doc/printf.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/body.texi b/doc/body.texi index 23b8b8fbc..a527db788 100644 --- a/doc/body.texi +++ b/doc/body.texi @@ -1068,10 +1068,10 @@ int main(int argc, char *argv[]) @rem{/* call the generated code@comma{} passing its size as argument */} myFunction((char*)jit_address(end) - (char*)jit_address(start)); - jit_clear_state(); jit_disassemble(); + jit_clear_state(); jit_destroy_state(); finish_jit(); return 0; @@ -1127,15 +1127,15 @@ call must be done after the @code{emit} call or either a fatal error will happen (if @lightning{} is built with assertions enable) or an undefined value will be returned. -@item jit_clear_state(); -Note that @code{jit_clear_state} was called after executing jit in -this example. It was done because it must be called after any call -to @code{jit_address} or @code{jit_print}. - @item jit_disassemble(); @code{disassemble} will dump the generated code to standard output, unless @lightning{} was built with the disassembler disabled, in which case no output will be shown. + +@item jit_clear_state(); +Note that @code{jit_clear_state} was called after executing jit in +this example. It was done because it must be called after any call +to @code{jit_address} or @code{jit_print}. @end table @node RPN calculator diff --git a/doc/printf.c b/doc/printf.c index 85485412f..2ab0738eb 100644 --- a/doc/printf.c +++ b/doc/printf.c @@ -30,10 +30,10 @@ int main(int argc, char *argv[]) /* call the generated code, passing its size as argument */ myFunction((char*)jit_address(end) - (char*)jit_address(start)); - jit_clear_state(); jit_disassemble(); + jit_clear_state(); jit_destroy_state(); finish_jit(); return 0;