# HG changeset patch
# User Mario de Sousa <msousa@fe.up.pt>
# Date 1357237626 0
# Node ID 9c1bca18d3fa63610a61eaf9da6916bcc9642f47
# Parent  268bf4ca5fa1f8ea0976dd9bcb268952620ab069# Parent  d534db26cbd5e6b5aaafc987d17c61577880303a
merge

diff -r 268bf4ca5fa1 -r 9c1bca18d3fa stage3/constant_folding.cc
--- a/stage3/constant_folding.cc	Thu Jan 03 18:23:07 2013 +0000
+++ b/stage3/constant_folding.cc	Thu Jan 03 18:27:06 2013 +0000
@@ -448,6 +448,8 @@
 	if (!VALID_CVALUE(uint64, res))
 		return;
 	/* Test by pre-condition: If (UINT64_MAX / a) < b => overflow! */
+	if (0 == GET_CVALUE(uint64, a))
+		return; // multiplying by 0 will always result in 0, a valid result!	  
 	if ((UINT64_MAX / GET_CVALUE(uint64, a)) < GET_CVALUE(uint64, b))
 		SET_OVFLOW(uint64, res);
 }