shithub: libmujs

Download patch

ref: 52c22be9c4147e84968042f0993e247231ea5943
parent: bb65f18fcc76fda0870e0c45c4c0ade770979182
author: Tor Andersson <tor@ccxvii.net>
date: Mon Mar 25 17:00:59 EDT 2019

Fix MSVC compile errors.

--- a/jscompile.c
+++ b/jscompile.c
@@ -554,8 +554,8 @@
 
 static void ceval(JF, js_Ast *fun, js_Ast *args)
 {
-	F->lightweight = 0;
 	int n = cargs(J, F, args);
+	F->lightweight = 0;
 	if (n == 0)
 		emit(J, F, OP_UNDEF);
 	else while (n-- > 1)
@@ -1388,8 +1388,7 @@
 			emitfunction(J, F, newfun(J, stm->line, stm->a, stm->b, stm->c, 0, F->strict));
 			emitline(J, F, stm);
 			emit(J, F, OP_SETLOCAL);
-			int v = addlocal(J, F, stm->a, 0);
-			emitarg(J, F, v);
+			emitarg(J, F, addlocal(J, F, stm->a, 0));
 			emit(J, F, OP_POP);
 		}
 		list = list->b;