Skip to content

Support/Regex is unaware of LLP64(Win64) #9159

Description

@llvmbot
Bugzilla Link 8787
Resolution WONTFIX
Resolved on Nov 06, 2014 15:11
Version trunk
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#9100
Reporter LLVM Bugzilla Contributor
CC @rnk

Extended Description

in regexec.c:

/* macros for manipulating states, small version /
#define states long /
i32 */
#define states1 states

#include "regengine.inc"

/* now undo things */
#undef states

/* macros for manipulating states, large version */
#define states char *

if (g->nstates <= (long)(CHAR_BIT*sizeof(states1)) ...

"states1" is expanded as "char *", and the condition becomes true
even if nstates > 32. Then regex might behave buggy.

Workaround:
--- a/lib/Support/regexec.c
+++ b/lib/Support/regexec.c
@@ -54,8 +54,8 @@
#include "regex2.h"

/* macros for manipulating states, small version /
-#define states long
-#define states1 states /
for later use in llvm_regexec() decision /
+#define states1 long /
for later use in llvm_regexec() decision */
+#define states states1
#define CLEAR(v) ((v) = 0)
#define SET0(v, n) ((v) &= ~((unsigned long)1 << (n)))
#define SET1(v, n) ((v) |= (unsigned long)1 << (n))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillawontfixIssue is real, but we can't or won't fix it. Not invalid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions