shithub: scc

Download patch

ref: 4865d137aa87e8ee60c39888f7febf3bbcaa2f4b
parent: 48a6d7f71087fc26fe03b357a22db8b93c6b7de6
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Aug 29 11:31:59 EDT 2018

[tests/scc] Avoid division by zero

i had a value of 0 due to the previous operations, so
the test was going to generate wrong results in this
case.

--- a/tests/scc/execute/0141-int-iden.c
+++ b/tests/scc/execute/0141-int-iden.c
@@ -28,7 +28,10 @@
 	i = i * 1;
 	i = 1 * i;
 	i = i / 1;
-	i = 1 / i;
+
+	if (i)
+		i = 1 / i;
+
 	i = i & ~0;
 	i = ~0 & i;
 	i = i % 1;