[llvm] 9f1521b - [Support] Fix incorrect assertion in backref compilation

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 07:56:57 PST 2023


Author: Nikita Popov
Date: 2023-01-16T16:56:33+01:00
New Revision: 9f1521b6da09a336c11c400506ea3200bf585210

URL: https://github.com/llvm/llvm-project/commit/9f1521b6da09a336c11c400506ea3200bf585210
DIFF: https://github.com/llvm/llvm-project/commit/9f1521b6da09a336c11c400506ea3200bf585210.diff

LOG: [Support] Fix incorrect assertion in backref compilation

These should be == rather than !=.

Added: 
    

Modified: 
    llvm/lib/Support/regcomp.c

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/regcomp.c b/llvm/lib/Support/regcomp.c
index 24d01121820b..9d484195a6d6 100644
--- a/llvm/lib/Support/regcomp.c
+++ b/llvm/lib/Support/regcomp.c
@@ -525,8 +525,8 @@ p_ere_exp(struct parse *p)
 			assert(backrefnum <= p->g->nsub);
 			EMIT(OBACK_, backrefnum);
 			assert(p->pbegin[backrefnum] != 0);
-			assert(OP(p->strip[p->pbegin[backrefnum]]) != OLPAREN);
-			assert(OP(p->strip[p->pend[backrefnum]]) != ORPAREN);
+			assert(OP(p->strip[p->pbegin[backrefnum]]) == OLPAREN);
+			assert(OP(p->strip[p->pend[backrefnum]]) == ORPAREN);
 			(void) dupl(p, p->pbegin[backrefnum]+1, p->pend[backrefnum]);
 			EMIT(O_BACK, backrefnum);
 			p->g->backrefs = 1;


        


More information about the llvm-commits mailing list