Skip to content

Commit 21a997c

Browse files
committed
Make getMaxBits deal with Block
1 parent e6d02fa commit 21a997c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ir/bits.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ Index getMaxBits(Expression* curr,
456456
if (LoadUtils::isSignRelevant(load) && !load->signed_) {
457457
return 8 * load->bytes;
458458
}
459+
} else if (auto* block = curr->dynCast<Block>()) {
460+
// TODO: getFallthrough(block, ..., ...) is needed,
461+
// because the localset also need it
462+
if (!block->name.is() && block->list.size() > 0) {
463+
return getMaxBits(block->list.back(), localInfoProvider);
464+
}
459465
}
460466
switch (curr->type.getBasic()) {
461467
case Type::i32:

0 commit comments

Comments
 (0)