Commit 327d40e7a3

LemonBoy <thatlemon@gmail.com>
2020-02-12 23:10:08
Fix a UAF when verbose-llvm-ir is specified
The g->module is long gone when codegen_link is called.
1 parent ab4ea5d
Changed files (1)
src/link.cpp
@@ -2642,13 +2642,6 @@ void codegen_link(CodeGen *g) {
     lj.rpath_table.init(4);
     lj.codegen = g;
 
-    if (g->verbose_llvm_ir) {
-        fprintf(stderr, "\nOptimization:\n");
-        fprintf(stderr, "---------------\n");
-        fflush(stderr);
-        LLVMDumpModule(g->module);
-    }
-
     if (g->out_type == OutTypeObj) {
         lj.args.append("-r");
     }