Sfoglia il codice sorgente

Force fallback source name for stripped bytecode.

Reported by Lyrth. #1319
Mike Pall 8 mesi fa
parent
commit
e2e0b1dd2d
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/lj_bcread.c

+ 1 - 1
src/lj_bcread.c

@@ -443,7 +443,7 @@ static int bcread_header(LexState *ls)
 #endif
 #endif
   }
   }
   if ((flags & BCDUMP_F_STRIP)) {
   if ((flags & BCDUMP_F_STRIP)) {
-    ls->chunkname = lj_str_newz(ls->L, ls->chunkarg);
+    ls->chunkname = lj_str_newz(ls->L, *ls->chunkarg == BCDUMP_HEAD1 ? "=?" : ls->chunkarg);
   } else {
   } else {
     MSize len = bcread_uleb128(ls);
     MSize len = bcread_uleb128(ls);
     bcread_need(ls, len);
     bcread_need(ls, len);