Prechádzať zdrojové kódy

Unbreak luaot-trampoline

Hugo Musso Gualandi 4 rokov pred
rodič
commit
645588967a
2 zmenil súbory, kde vykonal 9 pridanie a 1 odobranie
  1. 9 0
      src/luaot.c
  2. 0 1
      src/luaot_switches.c

+ 9 - 0
src/luaot.c

@@ -159,7 +159,11 @@ int main(int argc, char **argv)
     output_file = fopen(output_filename, "w");
     if (output_file == NULL) { fatal_error(strerror(errno)); }
 
+    #if defined(LUAOT_USE_GOTOS)
     println("#include \"luaot_header.c\"");
+    #elif defined(LUAOT_USE_SWITCHES)
+    println("#include \"trampoline_header.c\"");
+    #endif
     printnl();
     print_functions(proto);
     printnl();
@@ -167,7 +171,12 @@ int main(int argc, char **argv)
     printnl();
     println("#define LUAOT_LUAOPEN_NAME luaopen_%s", module_name);
     printnl();
+    #if defined(LUAOT_USE_GOTOS)
     println("#include \"luaot_footer.c\"");
+    #elif defined(LUAOT_USE_SWITCHES)
+    println("#include \"trampoline_footer.c\"");
+    #endif
+
 }
 
 // Deduce the Lua module name given the file name

+ 0 - 1
src/luaot_switches.c

@@ -825,7 +825,6 @@ void create_function(Proto *f)
                  println("        last += GETARG_Ax(0x%08x) * (MAXARG_C + 1);", f->code[pc+1]);
                  println("        pc++;");
                 }
-                println("        }");
                 println("        if (last > luaH_realasize(h))  /* needs more space? */");
                 println("          luaH_resizearray(L, h, last);  /* preallocate it at once */");
                 println("        for (; n > 0; n--) {");