From a852156980986d6c5875981a49c16fe8b98875c3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 1 Sep 2018 09:59:04 -0700 Subject: Change the Literal class's operator== to be bitwise (#1661) The change means that nan values will be compared bitwise when writing A == B, and so the float rule of a nan is different from itself would not apply. I think this is a safer default. In particular this PR fixes a fuzz bug in the rse pass, which placed Literals in a hash table, and due to nan != nan, an infinite loop... Also, looks like we really want a bitwise comparison pretty much everywhere anyhow, as can be seen in the diff here. Really the single place we need a floaty comparison is in the intepreter where we implement f32.eq etc., and there the code was already using the proper code path anyhow. --- src/tools/execution-results.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/execution-results.h') diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index fe82c024a..1e8fba4ff 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -78,7 +78,7 @@ struct ExecutionResults { abort(); } std::cout << "[fuzz-exec] comparing " << name << '\n'; - if (!results[name].bitwiseEqual(other.results[name])) { + if (results[name] != other.results[name]) { std::cout << "not identical!\n"; abort(); } -- cgit v1.2.3