Skip to content

Commit ef28217

Browse files
sunfishcoderossberg
authored andcommitted
[test] Add tests for out-of-range NaN payloads (#1670)
1 parent f113ac4 commit ef28217

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/core/float_literals.wast

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@
352352
(module quote "(global f32 (f32.const 0x1.0p_+1))")
353353
"unknown operator"
354354
)
355+
(assert_malformed
356+
(module quote "(global f32 (f32.const nan:0x80_0000))")
357+
"constant out of range"
358+
)
355359

356360
(assert_malformed
357361
(module quote "(global f64 (f64.const _100))")
@@ -505,3 +509,7 @@
505509
(module quote "(global f64 (f64.const 0x1.0p_+1))")
506510
"unknown operator"
507511
)
512+
(assert_malformed
513+
(module quote "(global f64 (f64.const nan:0x10_0000_0000_0000))")
514+
"constant out of range"
515+
)

0 commit comments

Comments
 (0)