Skip to content

Commit

Permalink
fix: correct an error preventing correct compilation of the 'break' s…
Browse files Browse the repository at this point in the history
…tatement when inside a switch
  • Loading branch information
jacopodl committed Mar 5, 2024
1 parent 0bcbbd7 commit 78d6da0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions argon/lang/compiler2/transl_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ JBlock *TranslationUnit::JBFindLabel(const String *label, unsigned short &out_po
for (auto *block = this->jblock; block != nullptr; block = block->prev) {
out_pops += block->pops;

if (label == nullptr && (block->type == JBlockType::LOOP || block->type == JBlockType::SWITCH))
return block;

if (block->type != JBlockType::LOOP)
continue;

if (label == nullptr)
return block;

if (block->label != nullptr && StringCompare(block->label, label) == 0)
return block;
}
Expand Down

0 comments on commit 78d6da0

Please sign in to comment.