Skip to content

bogus 'yyaccept' in '-c' mode #46

@skvadrik

Description

@skvadrik

Consider the following re2c source (1.re):

/*!re2c
    <c1> "b" {}
    <c1> "bbb" {}

    <c2> "a" {}
    <c2> "aaa" {}
    <c2> "aaaaa" {}
*/

Build and grep all 'yyaccept' and 'yyc_' (condition borders):

$ re2c -c 1.re | grep "yyaccept\|yyc_"
        unsigned int yyaccept = 0;
        case yycc1: goto yyc_c1;
        case yycc2: goto yyc_c2;
yyc_c1:
        yyaccept = 0;
yyc_c2:
        if (yyaccept == 0) {
        yyaccept = 0;
        yyaccept = 1;

What do we have here? Condition 'c1' assigns 'yyaccept' a value but never uses it (because it doesn't need it).

Reproduced with 0.13.6, 0.14.2 and HEAD.

Original comment by: skvadrik

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions