Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Having multiple unnamed main reactors causes nullPointerException #905

Closed
housengw opened this issue Jan 27, 2022 · 3 comments · Fixed by #965
Closed

Having multiple unnamed main reactors causes nullPointerException #905

housengw opened this issue Jan 27, 2022 · 3 comments · Fixed by #965
Labels
bug Something isn't working validation

Comments

@housengw
Copy link
Contributor

housengw commented Jan 27, 2022

minimal example

target C;
main reactor {}
main reactor {}

output

Generating code for: file: ...
******** mode: STANDALONE
******** source file: ...
******** generated sources: ...
******** generated binaries: ...
******** Using 1 threads.
lfc: fatal error: An unexpected error occurred:
java.lang.NullPointerException
	at org.lflang.generator.c.CGenerator.selfStructType(CGenerator.java:5419)
	at org.lflang.generator.c.CGenerator.generateSelfStruct(CGenerator.java:2554)
	at org.lflang.generator.c.CGenerator.generateReactorFederated(CGenerator.java:2185)
	at org.lflang.generator.c.CGenerator.generateReactorDefinitionsForFederate(CGenerator.java:1333)
	at org.lflang.generator.c.CGenerator.doGenerate(CGenerator.java:774)
	at org.lflang.generator.LFGenerator.doGenerate(LFGenerator.java:163)
	at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:44)
	at org.eclipse.xtext.generator.GeneratorDelegate.generate(GeneratorDelegate.java:35)
	at org.lflang.lfc.Main.runGenerator(Main.java:278)
	at org.lflang.lfc.Main.main(Main.java:207)

Having multiple unnamed federated reactor does not cause this issue.

@housengw housengw added bug Something isn't working validation labels Jan 27, 2022
@housengw
Copy link
Contributor Author

the problem seems to be local to my laptop

@lhstrh
Copy link
Member

lhstrh commented Jan 27, 2022

The duplicate reactor check doesn't work on anonymous main reactors. The above example should trigger an error, which it currently doesn't.

@edwardalee
Copy link
Collaborator

Fixed by PR #965.

@lhstrh lhstrh changed the title multiple unnamed main reactor causes nullPointerException Having multiple unnamed main reactors causes nullPointerException Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants