Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Dec 14, 2010 · 5 comments
Closed

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

llvmbot opened this issue Dec 14, 2010 · 5 comments
Labels
bugzilla Issues migrated from bugzilla wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Member

llvmbot commented Dec 14, 2010

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))

@lattner
Copy link
Collaborator

lattner commented Dec 15, 2010

Looks fine to me, please apply if there are no testsuite regressions. Please send patches to llvm-commits,

-Chris

@llvmbot
Copy link
Member Author

llvmbot commented Dec 16, 2010

I have committed above as r121942.
I think it is still workaround.
I added FIXME and I will leave this issue opened.

/* FIXME: 'states' is assumed as 'long' on small version. */

Consider, to 'states, giving 'uint64_t' on i686,
and giving 'short' on any hosts.

Looks fine to me, please apply if there are no testsuite regressions. Please
send patches to llvm-commits,

I see, thank you!

@rnk
Copy link
Collaborator

rnk commented Nov 6, 2014

I have committed above as r121942.
I think it is still workaround.
I added FIXME and I will leave this issue opened.

/* FIXME: 'states' is assumed as 'long' on small version. */

Consider, to 'states, giving 'uint64_t' on i686,
and giving 'short' on any hosts.

I don't think we need to do anything here. This workaround has held up fine for four years, and by the time it stops working we can switch to C++11 . This is still marked as blocking a win64 self-host, which already works.

Feel free to reopen if you feel otherwise.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 6, 2014

Yes, we won't fix this anymore. :)

@llvmbot
Copy link
Member Author

llvmbot commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#9100

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

4 participants