shithub: libmujs

Download patch

ref: 8e57b47c5d70376900cb3f9821bbfa6136d00078
parent: ce02a9d72953bf65c357d0fcd62cb2d1cfb49808
author: Tor Andersson <tor.andersson@artifex.com>
date: Fri Mar 8 06:56:05 EST 2019

Only emit line ops for actual exit handler statements.

--- a/jscompile.c
+++ b/jscompile.c
@@ -893,14 +893,17 @@
 	js_Ast *prev;
 	do {
 		prev = node, node = node->parent;
-		emitline(J, F, node);
 		switch (node->type) {
-		default: /* impossible */ break;
+		default:
+			/* impossible */
+			break;
 		case STM_WITH:
+			emitline(J, F, node);
 			emit(J, F, OP_ENDWITH);
 			break;
 		case STM_FOR_IN:
 		case STM_FOR_IN_VAR:
+			emitline(J, F, node);
 			/* pop the iterator if leaving the loop */
 			if (F->script) {
 				if (T == STM_RETURN || T == STM_BREAK || (T == STM_CONTINUE && target != node)) {
@@ -921,6 +924,7 @@
 			}
 			break;
 		case STM_TRY:
+			emitline(J, F, node);
 			/* came from try block */
 			if (prev == node->a) {
 				emit(J, F, OP_ENDTRY);