Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for ASTUtils.width() returnning -1 even when the width can be inferred from connections #1287

Merged
merged 4 commits into from
Jul 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions org.lflang/src/org/lflang/generator/RuntimeRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ public RuntimeRange(
int maxWidth = instance.width; // Initial value.
NamedInstance<?> parent = instance.parent;
while (parent.depth > 0) {
maxWidth *= parent.width;
if (parent.width > 0) {
// Skip when width is not positive (e.g., delay reactor instance)
maxWidth *= parent.width;
}
parent = parent.parent;
}
this.maxWidth = maxWidth;
Expand Down Expand Up @@ -508,4 +511,4 @@ public Port(PortInstance instance, int start, int width, Set<ReactorInstance> in
super(instance, start, width, interleaved);
}
}
}
}