shithub: libmujs

Download patch

ref: f52bbd89be80cfecc6eebeb05b3817c2b0bc49e5
parent: ecabfe425880cf022e43e9a0b101915de9c2ea2a
author: Tor Andersson <[email protected]>
date: Sat Jan 25 09:47:38 EST 2014

Fix bug in case OP_INITPROP_N where we used the value as the key.

--- a/jsrun.c
+++ b/jsrun.c
@@ -773,11 +773,10 @@
 			break;
 
 		case OP_INITPROP_N:
-			js_pushnumber(J, *pc++);
-			str = js_tostring(J, -2);
-			obj = js_toobject(J, -3);
+			str = jsV_numbertostring(J, *pc++);
+			obj = js_toobject(J, -2);
 			jsR_setproperty(J, obj, str, -1);
-			js_pop(J, 2);
+			js_pop(J, 1);
 			break;
 
 		case OP_GETPROP: