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

remove implicit fallthroughs (#1194) #1196

Merged
merged 4 commits into from Sep 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tools/translate-to-fuzz.h
Expand Up @@ -639,8 +639,8 @@ class TranslateToFuzzReader {
}
}
switch (conditions) {
case 0: if (!oneIn(4)) continue;
case 1: if (!oneIn(2)) continue;
case 0: if (!oneIn(4)) continue; break;
Copy link
Member

@dschuff dschuff Sep 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having it all on one line like this makes this difficult to read (i.e. it's not obvious that the continue is conditional but the break is not). Could we do

case 0:
 if (!oneIn(4)) continue;
 break;

instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Changed in b377dde.

case 1: if (!oneIn(2)) continue; break;
default: if (oneIn(conditions + 1)) continue;
}
return builder.makeBreak(name);
Expand Down
1 change: 1 addition & 0 deletions src/wasm/wasm-s-parser.cpp
Expand Up @@ -874,6 +874,7 @@ Expression* SExpressionWasmBuilder::makeExpression(Element& s) {
}
case 'w': {
if (!strncmp(str, "wake", strlen("wake"))) return makeAtomicWake(s);
abort_on(str);
}
default: abort_on(str);
}
Expand Down