ソースを参照

Bugfix; Remember to call updatebase if trap is set

vmfetch does this, so we should too.
Hugo Musso Gualandi 5 年 前
コミット
88a6fa4093
2 ファイル変更4 行追加4 行削除
  1. 1 0
      src/luaot.c
  2. 3 4
      src/luaot_header.c

+ 1 - 0
src/luaot.c

@@ -621,6 +621,7 @@ void create_function(Proto *p)
         }
 
         println("  label_%02d : {", pc);
+        println("    aot_check_trap();");
         println("    Instruction i = 0x%08x;", instr);
         println("    StkId ra = RA(i);");
         println("    (void) ra;");

+ 3 - 4
src/luaot_header.c

@@ -115,13 +115,12 @@
 #undef  savepc
 #define savepc(L)	(ci->u.l.savedpc = LUA_AOT_PC)
 
-
 //
-// Our modified "bytecode fetch". Since instr and index are compile time constants,
-// the C compiler should be able to optimize the code in many cases.
+// Our modified version of vmfetch(). Since instr and index are compile time
+// constants, the C compiler should be able to optimize the code in many cases.
 //
 
-#define aot_check_trap() { \
+#define aot_check_trap() \
   if (trap) {  /* stack reallocation or hooks? */ \
     trap = luaG_traceexec(L, LUA_AOT_PC - 1);  /* handle hooks */ \
     updatebase(ci);  /* correct stack */ \