From: François PERRAD <[EMAIL PROTECTED]>
   Date: Mon, 05 Nov 2007 12:06:39 +0100

   >>2) Directive .const with empty string

   I think it's bug too, I don't understand the limitation : everything except 
   empty string

   Francois

Definitely a bug; the attached patch seems to fix it.  If you would
kindly confirm that it works, I'll add a proper test case.  (Any ideas
where such a test case should go?)

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/

* compilers/imcc/imcc.y:
   + (mk_pmc_const):  Fix strlen bug, which broke empty strings.
* compilers/imcc/imcparser.c:
   + Fix translated version.

Diffs between last version checked in and current workfile(s):

Index: compilers/imcc/imcc.y
===================================================================
--- compilers/imcc/imcc.y       (revision 22692)
+++ compilers/imcc/imcc.y       (working copy)
@@ -223,7 +223,7 @@
     ascii = (*constant == '\'' || *constant == '"');
     if (ascii) {
         /* strip delimiters */
-        const size_t len  = strlen(constant);
+        const size_t len  = strlen(constant)+1;
         name              = (char *)mem_sys_allocate(len);
         constant[len - 1] = '\0';
 
Index: compilers/imcc/imcparser.c
===================================================================
--- compilers/imcc/imcparser.c  (revision 22692)
+++ compilers/imcc/imcparser.c  (working copy)
@@ -541,7 +541,7 @@
     ascii = (*constant == '\'' || *constant == '"');
     if (ascii) {
         /* strip delimiters */
-        const size_t len  = strlen(constant);
+        const size_t len  = strlen(constant)+1;
         name              = (char *)mem_sys_allocate(len);
         constant[len - 1] = '\0';
 

End of diffs.

Reply via email to