aboutsummaryrefslogtreecommitdiff
path: root/src/include/regex/regguts.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/regex/regguts.h')
-rw-r--r--src/include/regex/regguts.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/regex/regguts.h b/src/include/regex/regguts.h
index 5d0e7a961c9..0a616562d03 100644
--- a/src/include/regex/regguts.h
+++ b/src/include/regex/regguts.h
@@ -368,7 +368,15 @@ struct cnfa
struct carc *arcs; /* the area for the lists */
};
+/*
+ * When debugging, it's helpful if an un-filled CNFA is all-zeroes.
+ * In production, though, we only require nstates to be zero.
+ */
+#ifdef REG_DEBUG
+#define ZAPCNFA(cnfa) memset(&(cnfa), 0, sizeof(cnfa))
+#else
#define ZAPCNFA(cnfa) ((cnfa).nstates = 0)
+#endif
#define NULLCNFA(cnfa) ((cnfa).nstates == 0)
/*