Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/wasm/wat-lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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 {};
Expand Down
2 changes: 2 additions & 0 deletions src/wat-lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down