binpac: Add a comment in the generated C++ code for fall through in switch

A common BinPAC construct for parsing records is a switch statement,
with no breaks between the cases, as control is expected to fall
through.

Coverity raises an error about this; this commit should fix that.
This commit is contained in:
Vlad Grigorescu 2016-05-06 15:07:05 -05:00 committed by Tim Wojtulewicz
parent a9d294528d
commit dc49b0343f

View file

@ -446,6 +446,7 @@ void RecordDataField::GenParseCode(Output* out_cc, Env* env)
out_cc->println("%s = %d;", out_cc->println("%s = %d;",
env->LValue(parsing_state_id), env->LValue(parsing_state_id),
parsing_state_seq()); parsing_state_seq());
out_cc->println("/* fall through */");
out_cc->dec_indent(); out_cc->dec_indent();
out_cc->println("case %d:", parsing_state_seq()); out_cc->println("case %d:", parsing_state_seq());
out_cc->inc_indent(); out_cc->inc_indent();