qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs qe.h extras.c variables.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qe.h extras.c variables.c
Date: Fri, 22 Nov 2013 20:50:21 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        13/11/22 20:50:21

Modified files:
        .              : qe.h extras.c variables.c 

Log message:
        - added compile time test for qe_free argument type: must be pointer to 
pointer
        - fixed crash bug in qe_unregister_binding1, missing indirection in 
qe_free argument
        - added Darwin specific definition for 'end' (this is an ugly patch, to 
be removed)
        - fixed crash bug in qe_set_variable, missing indirection in qe_free 
argument

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/qemacs/extras.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/variables.c?cvsroot=qemacs&r1=1.8&r2=1.9

Patches:
Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- qe.h        4 May 2008 15:54:39 -0000       1.96
+++ qe.h        22 Nov 2013 20:50:20 -0000      1.97
@@ -102,7 +102,7 @@
 #define qe_malloc_hack(t, n)    ((t *)qe_malloc_bytes(sizeof(t) + (n)))
 #define qe_mallocz_hack(t, n)   ((t *)qe_mallocz_bytes(sizeof(t) + (n)))
 #define qe_free(pp)      \
-    do { void *_ = (pp); free(*(void **)_); *(void **)_ = NULL; } while (0)
+    do if (sizeof(**(pp)) >= 0) { void *_ = (pp); free(*(void **)_); *(void 
**)_ = NULL; } while (0)
 
 /************************/
 

Index: extras.c
===================================================================
RCS file: /sources/qemacs/qemacs/extras.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- extras.c    2 May 2008 17:11:19 -0000       1.10
+++ extras.c    22 Nov 2013 20:50:21 -0000      1.11
@@ -358,7 +358,7 @@
         {
             p = *lp;
             *lp = (*lp)->next;
-            qe_free(p);
+            qe_free(&p);
             return 1;
         }
         lp = &(*lp)->next;

Index: variables.c
===================================================================
RCS file: /sources/qemacs/qemacs/variables.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- variables.c 30 Apr 2008 07:18:34 -0000      1.8
+++ variables.c 22 Nov 2013 20:50:21 -0000      1.9
@@ -202,6 +202,9 @@
  * assumed to be allocated with qe_malloc
  */
 extern u8 end[];
+#ifdef CONFIG_DARWIN
+u8 end[8];  /* FIXME: not really at the end, but beyond the bss, should remove 
this dependency */
+#endif
 
 QVarType qe_set_variable(EditState *s, const char *name,
                          const char *value, int num)
@@ -263,7 +266,7 @@
             }
             pstr = (char **)ptr;
             if ((u8 *)*pstr > end)
-                qe_free(*pstr);
+                qe_free(pstr);
             *pstr = qe_strdup(value);
             break;
         case VAR_CHARS:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]