Skip to content

Commit fda1d1e

Browse files
fix option discriminant when lowering
1 parent 8a12d58 commit fda1d1e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

gabagool/src/store.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,10 +1298,14 @@ impl Store {
12981298
let payload_count = inner_ty.flat_count(types);
12991299

13001300
match opt {
1301-
None => flat.extend(std::iter::repeat_n(
1302-
RawValue::from(i32::MAX),
1303-
payload_count + 1,
1304-
)),
1301+
None => {
1302+
flat.extend(
1303+
std::iter::once(RawValue::from(0i32)).chain(std::iter::repeat_n(
1304+
RawValue::from(i32::MAX),
1305+
payload_count,
1306+
)),
1307+
);
1308+
}
13051309
Some(value) => {
13061310
flat.push(RawValue::from(1i32));
13071311
self.lower_value(*value, None, types, lifted, flat)?;

0 commit comments

Comments
 (0)