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

Dead code in the code generator #473

Open
psychon opened this issue Jun 7, 2020 · 1 comment
Open

Dead code in the code generator #473

psychon opened this issue Jun 7, 2020 · 1 comment
Labels
P5 Priority Nice-to-have

Comments

@psychon
Copy link
Owner

psychon commented Jun 7, 2020

As far as I can see, there is no fixed size switch anywhere. Put differently, the following patch causes no problems (well, some compiler warnings, but that's it):

diff --git a/generator/src/generator/namespace.rs b/generator/src/generator/namespace.rs
index 0ae83a6..09dd7f7 100644
--- a/generator/src/generator/namespace.rs
+++ b/generator/src/generator/namespace.rs
@@ -2990,6 +2990,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
 
         if generate_serialize {
             if let Some(size) = switch.size() {
+                unreachable!();
                 self.emit_fixed_size_switch_serialize(
                     switch,
                     name,

I'm not quite sure what to do with this knowledge. Remove the dead code from the code generator?

@psychon psychon added the P5 Priority Nice-to-have label Jun 7, 2020
@eduardosm
Copy link
Collaborator

I think I had added that thinking of #369. For example, if ClientMessageData gets replaced by a switch, that switch needs to be handled as a fixed size type because it is inside a non-GE event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P5 Priority Nice-to-have
Projects
None yet
Development

No branches or pull requests

2 participants