[S] Change in code/re2[main]: Attempt to address some `-Wunreachable-code` warnings.

1 view
Skip to first unread message

Paul Wankadia (Gerrit)

unread,
Aug 5, 2022, 5:36:45 AM8/5/22
to Paul Wankadia, re2...@googlegroups.com

Paul Wankadia has uploaded this change for review.

View Change

Attempt to address some `-Wunreachable-code` warnings.

Fixes #384.

Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
---
M re2/compile.cc
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/re2/compile.cc b/re2/compile.cc
index 61d801a..03bffab 100644
--- a/re2/compile.cc
+++ b/re2/compile.cc
@@ -789,8 +789,8 @@
// Should not be called.
Frag Compiler::Copy(Frag arg) {
// We're using WalkExponential; there should be no copying.
- LOG(DFATAL) << "Compiler::Copy called!";
failed_ = true;
+ LOG(DFATAL) << "Compiler::Copy called!";
return NoMatch();
}

@@ -916,8 +916,8 @@
CharClass* cc = re->cc();
if (cc->empty()) {
// This can't happen.
- LOG(DFATAL) << "No ranges in char class";
failed_ = true;
+ LOG(DFATAL) << "No ranges in char class";
return NoMatch();
}

@@ -974,8 +974,8 @@
case kRegexpNoWordBoundary:
return EmptyWidth(kEmptyNonWordBoundary);
}
- LOG(DFATAL) << "Missing case in Compiler: " << re->op();
failed_ = true;
+ LOG(DFATAL) << "Missing case in Compiler: " << re->op();
return NoMatch();
}


To view, visit change 60350. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: re2
Gerrit-Branch: main
Gerrit-Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
Gerrit-Change-Number: 60350
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Wankadia <jun...@google.com>
Gerrit-MessageType: newchange

Perry Lorier (Gerrit)

unread,
Aug 5, 2022, 6:02:09 AM8/5/22
to Paul Wankadia, Randall Bosetti, re2...@googlegroups.com

Attention is currently required from: Paul Wankadia.

Patch set 1:Code-Review +1

View Change

    To view, visit change 60350. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: re2
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
    Gerrit-Change-Number: 60350
    Gerrit-PatchSet: 1
    Gerrit-Owner: Paul Wankadia <jun...@google.com>
    Gerrit-Reviewer: Perry Lorier <per...@google.com>
    Gerrit-CC: Randall Bosetti <r...@google.com>
    Gerrit-Attention: Paul Wankadia <jun...@google.com>
    Gerrit-Comment-Date: Fri, 05 Aug 2022 10:02:06 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Paul Wankadia (Gerrit)

    unread,
    Aug 5, 2022, 6:20:41 AM8/5/22
    to Paul Wankadia, Perry Lorier, Randall Bosetti, re2...@googlegroups.com

    Patch set 1:Code-Review +2

    View Change

      To view, visit change 60350. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: re2
      Gerrit-Branch: main
      Gerrit-Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
      Gerrit-Change-Number: 60350
      Gerrit-PatchSet: 1
      Gerrit-Owner: Paul Wankadia <jun...@google.com>
      Gerrit-Reviewer: Paul Wankadia <jun...@google.com>
      Gerrit-Reviewer: Perry Lorier <per...@google.com>
      Gerrit-CC: Randall Bosetti <r...@google.com>
      Gerrit-Comment-Date: Fri, 05 Aug 2022 10:20:35 +0000

      Paul Wankadia (Gerrit)

      unread,
      Aug 5, 2022, 6:20:45 AM8/5/22
      to Paul Wankadia, Perry Lorier, Randall Bosetti, re2...@googlegroups.com

      Paul Wankadia submitted this change.

      View Change


      Approvals: Paul Wankadia: Looks good to me, approved Perry Lorier: Looks good to me, but someone else must approve
      Attempt to address some `-Wunreachable-code` warnings.

      Fixes #384.

      Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
      Reviewed-on: https://code-review.googlesource.com/c/re2/+/60350
      Reviewed-by: Paul Wankadia <jun...@google.com>
      Reviewed-by: Perry Lorier <per...@google.com>
      ---
      M re2/compile.cc
      1 file changed, 17 insertions(+), 3 deletions(-)

      To view, visit change 60350. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: re2
      Gerrit-Branch: main
      Gerrit-Change-Id: Ic78c6330716ed4c1ece8b064fc57ee960fdfa4ab
      Gerrit-Change-Number: 60350
      Gerrit-PatchSet: 2
      Gerrit-Owner: Paul Wankadia <jun...@google.com>
      Gerrit-Reviewer: Paul Wankadia <jun...@google.com>
      Gerrit-Reviewer: Perry Lorier <per...@google.com>
      Gerrit-CC: Randall Bosetti <r...@google.com>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages