shithub: libmujs

Download patch

ref: 3d3f473c399186d229bc0313d3f4efaef0cc5bdb
parent: 69b312d13bcff1743b5954c191292863fd1ec42c
author: Tor Andersson <tor.andersson@artifex.com>
date: Mon Nov 11 06:02:54 EST 2019

Bug 701887: Create arguments if eval is present.

We can't know at compile time that the 'arguments' object will not be used
from the eval statement, so err on the side of caution and always create
the arguments object if eval can be called.

--- a/jscompile.c
+++ b/jscompile.c
@@ -556,6 +556,7 @@
 {
 	int n = cargs(J, F, args);
 	F->lightweight = 0;
+	F->arguments = 1;
 	if (n == 0)
 		emit(J, F, OP_UNDEF);
 	else while (n-- > 1)