Re: Different bytecode generation from static lib and lua executable

  • From: Mike Pall <mike-1206@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 27 Jun 2012 18:36:37 +0200

Niklas Frykholm wrote:
> I have a particular lua file that gets compiled differently depending
> on whether I use the luajit.exe or if I make my own exe and statically
> link it to luajit.lib.

Does the attached patch fix the problem?

--Mike
--- a/src/lj_bcwrite.c
+++ b/src/lj_bcwrite.c
@@ -178,6 +178,7 @@ static void bcwrite_kgc(BCWriteCtx *ctx, GCproto *pt)
     } else {
       lua_assert(o->gch.gct == ~LJ_TTAB);
       tp = BCDUMP_KGC_TAB;
+      need = 1+2*5;
     }
     /* Write constant type. */
     bcwrite_need(ctx, need);

Other related posts: