shithub: mc

Download patch

ref: 6df66e51fcfa4982eaba21965b8e5a5be5d52575
parent: 969945de572d39acd871f2d9371ea81b841c538a
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jun 24 05:14:02 EDT 2017

Fix uninitialized variable access.

--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -586,15 +586,16 @@
 		sval = -(bits : int64)
 		val = (sval : uint64)
 		isneg = true
+
+		/* if its negative after inverting, we have int64 min */
+		if sval < 0
+			std.sbputs(sb, "-9223372036854775808")
+			-> void
+		;;
 	else
 		val = (bits : uint64)
 		val &= ~0 >> (8*(sizeof(uint64)-sizeof(@a)))
 		isneg = false
-	;;
-	/* if its negative after inverting, we have int64 min */
-	if sval < 0
-		std.sbputs(sb, "-9223372036854775808")
-		-> void
 	;;
 
 	i = 0