-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing out-of-bounds
nan
constants (#1111)
* Fix parsing out-of-bounds `nan` constants Previously a float token in a wasm text file could trigger a panic if it was out of bounds, for example `nan:0xffffffffffffffff0` (16 `f` plus one `0`). This `.unwrap()` on a parse has been replaced with a fallible one to propagate the error handling. * Fix tests
- Loading branch information
1 parent
aa16158
commit 42f4bbf
Showing
3 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(assert_malformed | ||
(module quote "(func (result f64) (f64.const nan:0x11111111800800080))") | ||
"constant out of range") | ||
|
||
(assert_malformed | ||
(module quote "(func (result f64) (f64.const nan:0xffffffffffffffff0))") | ||
"constant out of range") | ||
|
||
(assert_malformed | ||
(module quote "(func (result f32) (f32.const nan:0xffffffff0))") | ||
"constant out of range") |