shithub: libmujs

Download patch

ref: 722c02ee1b4122a9edef5991f0c8e3abc8b51d95
parent: 0d83e44cc1b40213ebb440b04f6cfce720367fa6
author: Tor Andersson <[email protected]>
date: Tue Feb 11 09:25:33 EST 2014

Never compile scripts as lightweight functions.

--- a/jscompile.c
+++ b/jscompile.c
@@ -1159,6 +1159,9 @@
 	F->lightweight = 1;
 	F->arguments = 0;
 
+	if (F->script)
+		F->lightweight = 0;
+
 	if (body)
 		analyze(J, F, body);
 
@@ -1175,8 +1178,10 @@
 		}
 	}
 
-	cvardecs(J, F, body);
-	cfundecs(J, F, body);
+	if (body) {
+		cvardecs(J, F, body);
+		cfundecs(J, F, body);
+	}
 
 	if (F->script) {
 		emit(J, F, OP_UNDEF);