Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit a302d13

Browse files
author
Jakob Stoklund Olesen
committed
Don't pass SIMD values to equal().
This function is implemented in terms of 'a == b', which causes two problems: 1. It doesn't do the right thing for Float32x4(NaN, NaN, NaN, NaN), and 2. It depends on value semantics for '==' to work. Value semantics should only be tested by the testValueSemantics() function.
1 parent 69db65b commit a302d13

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/ecmascript_simd_tests.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,12 @@ function testCheck(type) {
393393
// Other SIMD types shouldn't check for this type.
394394
var a = type.fn();
395395
for (var otherType of simdTypes) {
396-
if (otherType === type)
397-
equal(a, type.fn.check(a));
398-
else
396+
if (otherType === type) {
397+
var result = type.fn.check(a);
398+
checkValue(type, result, function(index) { return type.fn.extractLane(a, index); });
399+
} else {
399400
throws(function() { otherType.check(a); });
401+
}
400402
}
401403
// Neither should other types.
402404
for (var x of [ {}, "", 0, 1, true, false, undefined, null, NaN, Infinity]) {

0 commit comments

Comments
 (0)