tag 505056 patch
thanks

Sergei Golovan <sgolo...@nes.ru> (23/11/2008):
> reopen 505056
> thanks
> 
> Hi!
> 
> Unfortunately, the bug remains on ia64 architecture. It's still
> triggered when building erlang: […]

Hello Sergei,

indeed, the fix was only partial, but the attached patch seems to do the
job, at least it's possible to process properly the file you mentioned
in the erlang source package.

Manoj, the attached patch is against the master branch of the declared
git repository. Note that I didn't check it doesn't break anything on
other architectures, but I'm pretty much confident. The rationale is
included in the commit message.

(As for the patch generation, I updated the .skl file, ran “make” to
update skel.c, and used “patch” to apply it to scan.c as well.)

Mraw,
KiBi.
Finish fixing the ia64 buffer issue.

Previous commits increased YY_READ_BUF_SIZE (where __ia64__ is defined) but
left YY_BUF_SIZE unchanged, so that didn't fix the problem in the end. In the
general case, the latter is twice the former. Therefore set it to the same
ratio in the ia64 case.

Signed-off-by: Cyril Brulebois <k...@debian.org>
---
 flex.skl |    8 ++++++++
 scan.c   |    8 ++++++++
 skel.c   |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/flex.skl b/flex.skl
index 61db701..2875cc1 100644
--- a/flex.skl
+++ b/flex.skl
@@ -443,7 +443,15 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
diff --git a/scan.c b/scan.c
index a3914c1..442dfcb 100644
--- a/scan.c
+++ b/scan.c
@@ -142,7 +142,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
diff --git a/skel.c b/skel.c
index 3a26b09..5a172d1 100644
--- a/skel.c
+++ b/skel.c
@@ -510,7 +510,15 @@ const char *skel[] = {
   "",
   "/* Size of default input buffer. */",
   "#ifndef YY_BUF_SIZE",
+  "#ifdef __ia64__",
+  "/* On IA-64, the buffer size is 16k, not 8k.",
+  " * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.",
+  " * Ditto for the __ia64__ case accordingly.",
+  " */",
+  "#define YY_BUF_SIZE 32768",
+  "#else",
   "#define YY_BUF_SIZE 16384",
+  "#endif /* __ia64__ */",
   "#endif",
   "",
   "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
-- 
1.5.6.5

Attachment: signature.asc
Description: Digital signature

Reply via email to