Skip to content

Commit

Permalink
HACK(eddyb): work around disaggregate losing type information from gl…
Browse files Browse the repository at this point in the history
…obal initializers.
  • Loading branch information
eddyb committed Oct 1, 2023
1 parent 250a7bd commit af076ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/qptr/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ impl<'a> LowerFromSpvPtrs<'a> {
global_var_decl.addr_space = AddrSpace::Handles;
}
}

// HACK(eddyb) see also below, but this should at least prevent
// errors if the global variable has a valid initializer already.
if let DeclDef::Present(def) = &global_var_decl.def {
if def.initializer.is_some() && shape_result.is_ok() {
shape_result = Ok(shapes::GlobalVarShape::TypedInterface(pointee_type));
}
}

match shape_result {
Ok(shape) => {
global_var_decl.shape = Some(shape);
Expand Down

0 comments on commit af076ba

Please sign in to comment.