shithub: libmujs

Download patch

ref: 577585c2d1580e831e07dcfd1cd0d036583a4422
parent: 588fdd18d6cdab241ee4af92cd854ff20fffb691
author: Tor Andersson <tor@ccxvii.net>
date: Tue Feb 18 10:17:33 EST 2014

Silence scan-build warnings about maybe uninitialized variables.

--- a/jscompile.c
+++ b/jscompile.c
@@ -821,10 +821,12 @@
 		}
 	}
 	emit(J, F, OP_POP);
-	if (def)
+	if (def) {
 		def->casejump = emitjump(J, F, OP_JUMP);
-	else
+		end = 0;
+	} else {
 		end = emitjump(J, F, OP_JUMP);
+	}
 
 	/* emit the casue clause bodies */
 	for (node = head; node; node = node->b) {
@@ -836,7 +838,7 @@
 			cstmlist(J, F, clause->b);
 	}
 
-	if (!def)
+	if (end)
 		label(J, F, end);
 }
 
@@ -929,6 +931,8 @@
 		if (stm->b) {
 			cexp(J, F, stm->b);
 			end = emitjump(J, F, OP_JFALSE);
+		} else {
+			end = 0;
 		}
 		cstm(J, F, stm->d);
 		cont = here(J, F);
@@ -937,7 +941,7 @@
 			emit(J, F, OP_POP);
 		}
 		emitjumpto(J, F, OP_JUMP, loop);
-		if (stm->b)
+		if (end)
 			label(J, F, end);
 		labeljumps(J, F, stm->jumps, here(J,F), cont);
 		break;