diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wat-lexer.cpp | 5 | ||||
-rw-r--r-- | src/wat-lexer.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/wasm/wat-lexer.cpp b/src/wasm/wat-lexer.cpp index 401ea6b7a..1992e9bab 100644 --- a/src/wasm/wat-lexer.cpp +++ b/src/wasm/wat-lexer.cpp @@ -222,6 +222,8 @@ struct LexFloatResult : LexResult { // The payload if we lexed a nan with payload. We cannot store the payload // directly in `d` because we do not know at this point whether we are parsing // an f32 or f64 and therefore we do not know what the allowable payloads are. + // No payload with NaN means to use the default payload for the expected float + // width. std::optional<uint64_t> nanPayload; double d; }; @@ -602,6 +604,9 @@ std::optional<LexFloatResult> float_(std::string_view in) { // TODO: Add error production for malformed NaN payload. return {}; } + } else { + // No explicit payload necessary; we will inject the default payload + // later. } } else { return {}; diff --git a/src/wat-lexer.h b/src/wat-lexer.h index d5c3b33ce..057d7eed7 100644 --- a/src/wat-lexer.h +++ b/src/wat-lexer.h @@ -69,6 +69,8 @@ struct FloatTok { // The payload if we lexed a nan with payload. We cannot store the payload // directly in `d` because we do not know at this point whether we are parsing // an f32 or f64 and therefore we do not know what the allowable payloads are. + // No payload with NaN means to use the default payload for the expected float + // width. std::optional<uint64_t> nanPayload; double d; |