Skip to content

Commit 5299ddf

Browse files
committed
Fix use of uninitialized value in WastParser::ParseSimdV128Const.
1 parent d8184ba commit 5299ddf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/wast-parser.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,9 @@ Result WastParser::ParseSimdV128Const(Const* const_,
29092909
break;
29102910
}
29112911

2912-
const_->set_expected_nan(lane, lane_const_.expected_nan());
2912+
if (Succeeded(result)) {
2913+
const_->set_expected_nan(lane, lane_const_.expected_nan());
2914+
}
29132915
}
29142916

29152917
if (Failed(result)) {
@@ -2952,7 +2954,7 @@ Result WastParser::ParseF32(Const* const_, ConstType const_type) {
29522954
}
29532955

29542956
auto literal = token.literal();
2955-
uint32_t f32_bits;
2957+
uint32_t f32_bits = 0;
29562958
Result result = ParseFloat(literal.type, literal.text, &f32_bits);
29572959
const_->set_f32(f32_bits);
29582960
return result;
@@ -2972,7 +2974,7 @@ Result WastParser::ParseF64(Const* const_, ConstType const_type) {
29722974
}
29732975

29742976
auto literal = token.literal();
2975-
uint64_t f64_bits;
2977+
uint64_t f64_bits = 0;
29762978
Result result = ParseDouble(literal.type, literal.text, &f64_bits);
29772979
const_->set_f64(f64_bits);
29782980
return result;

0 commit comments

Comments
 (0)