-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2011 from lf-lang/unconnected-outputs
Handling of unconnected outputs that avoids segmentation fault
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
Submodule reactor-c
updated
3 files
+4 −2 | core/reactor.c | |
+4 −2 | core/threaded/reactor_threaded.c | |
+6 −3 | util/tracing/visualization/fedsd.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Success here is not segfaulting. | ||
target C { | ||
timeout: 10 ms | ||
} | ||
|
||
reactor B(bank_index: int = 0) { | ||
input in: int | ||
output out_problem: int | ||
|
||
reaction(in) -> out_problem {= | ||
lf_set(out_problem, self->bank_index); | ||
=} | ||
} | ||
|
||
reactor A { | ||
input in: int | ||
output out1: int | ||
output out2: int | ||
output out3: int | ||
|
||
b = new[3] B() | ||
(in)+ -> b.in | ||
b.out_problem -> out1, out2, out3 | ||
} | ||
|
||
main reactor { | ||
m = new A() | ||
timer t(0, 10 ms) | ||
|
||
reaction(t) -> m.in {= | ||
lf_set(m.in, 42); | ||
=} | ||
|
||
reaction(m.out3) {= | ||
lf_print("out3 = %d", m.out3->value); | ||
if (m.out3->value != 2) { | ||
lf_print_error_and_exit("Expected 2."); | ||
} | ||
=} | ||
} |