gap-packages / ace

GAP interface for the the Advanced Coset Enumerator (ACE)
https://gap-packages.github.io/ace/
MIT License
3 stars 6 forks source link

enum.c:1706: possible missing break ? #7

Closed dcb314 closed 7 years ago

dcb314 commented 7 years ago
 case 58:
    if (result == -1 || result == 0)
      { cdapp = FALSE; }
  case 59:

All the other cases in the same switch have break. Why not this one ?

fingolfin commented 7 years ago

Giving some more context makes it easier to evaluate what goes on:

      case 58:
        if (result == -1 || result == 0)
          { cdapp = FALSE; }
      case 59:
        if (result == -1)
          { cdapp = TRUE; }
        break;
      }

So, we fall through to the final case. And if result==-1, then cdapp is first set to FALSE, and then later (by case 59) changed to TRUE. This looks indeed a lot like a bug.

And indeed, in ACE 4.1, there is a break now.