Skip to content

Commit

Permalink
Fix regression to collapsing literal structs
Browse files Browse the repository at this point in the history
A regression to collapsing literal structs was introduced in commit 5745eea.

Literal structs can always be collapsed into parent structs, since the parent cannot be literal aswell.
  • Loading branch information
Maqrkk authored and yuri91 committed Feb 27, 2024
1 parent 33b8bb5 commit 9669b0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CheerpUtils/TypeOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ bool TypeOptimizer::canCollapseStruct(llvm::StructType* st, llvm::StructType* ne
if (newStruct == nullptr)
{
assert(st->isLiteral());
return false;
return true;
}
// Stop if the element is just a int8, we may be dealing with an empty struct
// Empty structs are unsafe as the int8 inside is just a placeholder and will be replaced
Expand Down

0 comments on commit 9669b0a

Please sign in to comment.