]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 28 Dec 2003 23:33:48 +0000 (23:33 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 28 Dec 2003 23:33:48 +0000 (23:33 +0000)
* posix/regexec.c (re_copy_regs): Allocate start and end array in
one block.
(push_fail_stack): Add missing check for failed memory allocation.

_IO_peekc_unlocked, _IO_ptc_unlocked, _IO_getwc_unlocked, and
overflow for 0 as argument. Raise Invalid exception for negative args.

ChangeLog
linuxthreads/ChangeLog
linuxthreads/attr.c
posix/regexec.c

index 90df631e3742e7670ed3db844eaed46cef84d75d..011f910a9f3aabf7ae6793c12a3d8540a6dce0fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,17 @@
 2003-12-28  Ulrich Drepper  <drepper@redhat.com>
 
+       * posix/regexec.c (re_copy_regs): Allocate start and end array in
+       one block.
+       (push_fail_stack): Add missing check for failed memory allocation.
+
        * libio/libio.h: Use __builtin_expect in _IO_getc_unlocked,
-       _IO_peekc_unlocked, _IO_ptc_unlcoked, _IO_getwc_unlocked, and
+       _IO_peekc_unlocked, _IO_ptc_unlocked, _IO_getwc_unlocked, and
        _IO_putwc_unlocked.
 
 2003-12-28  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/ieee754/dbl-64/e_j0.c (__ieee754_y0): Raise only
-       overflow for 0 as argument. Raise Invalid exception for negative
-       args.
+       overflow for 0 as argument. Raise Invalid exception for negative args.
        * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_yn): Likewise.
        * sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_y0): Likewise.
        * sysdeps/ieee754/ldb-128/e_jnl.c (__ieee754_ynl): Likewise.
index 8bbbd6f4d10fc2fd37bcfbe4d188b92f14da8ef6..55e3d0aef9170a3cd3b9fcfa0c7bae5329afb6fd 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-28  Carlos O'Donell  <carlos@baldric.uwo.ca>
+
+       * attr.c (pthread_getattr_np): Add _STACK_GROWS_UP case.
+
 2003-12-26  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/pthread/pthread.h (pthread_setcancelstate,
index 56f6cba092d922e013e174c011ac3f8aa9a99c12..80f5249d3657e25a25b7d4037ba5ac713be67cfa 100644 (file)
@@ -455,12 +455,17 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
                {
                  /* Found the entry.  Now we have the info we need.  */
                  attr->__stacksize = rl.rlim_cur;
+#ifdef _STACK_GROWS_UP
+                 /* Don't check to enforce a limit on the __stacksize */
+                 attr->__stackaddr = (void *) from;
+#else
                  attr->__stackaddr = (void *) to;
 
                  /* The limit might be too high.  This is a bogus
                     situation but try to avoid making it worse.  */
                  if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr)
                    attr->__stacksize = (size_t) attr->__stackaddr;
+#endif
 
                  /* We succeed and no need to look further.  */
                  ret = 0;
index 973d1c788ff48aae9a26e89b272381585ad388e5..8f1f8c6b1fc3d12e8183fc153bce274d2caeff35 100644 (file)
@@ -453,16 +453,12 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated)
 
   /* Have the register data arrays been allocated?  */
   if (regs_allocated == REGS_UNALLOCATED)
-    { /* No.  So allocate them with malloc.  */
-      regs->start = re_malloc (regoff_t, need_regs);
+    { /* No.  So allocate them with malloc.  We allocate the arrays
+        for the start and end in one block.  */
+      regs->start = re_malloc (regoff_t, 2 * need_regs);
       if (BE (regs->start == NULL, 0))
        return REGS_UNALLOCATED;
-      regs->end = re_malloc (regoff_t, need_regs);
-      if (BE (regs->end == NULL, 0))
-       {
-         re_free (regs->start);
-         return REGS_UNALLOCATED;
-       }
+      regs->end = regs->start + need_regs;
       regs->num_regs = need_regs;
     }
   else if (regs_allocated == REGS_REALLOCATE)
@@ -471,19 +467,13 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated)
         leave it alone.  */
       if (BE (need_regs > regs->num_regs, 0))
        {
-         regs->start = re_realloc (regs->start, regoff_t, need_regs);
+         regs->start = re_realloc (regs->start, regoff_t, 2 * need_regs);
          if (BE (regs->start == NULL, 0))
            {
-             if (regs->end != NULL)
-               re_free (regs->end);
-             return REGS_UNALLOCATED;
-           }
-         regs->end = re_realloc (regs->end, regoff_t, need_regs);
-         if (BE (regs->end == NULL, 0))
-           {
-             re_free (regs->start);
+             regs->end = NULL;
              return REGS_UNALLOCATED;
            }
+         regs->end = regs->start + need_regs;
          regs->num_regs = need_regs;
        }
     }
@@ -1243,6 +1233,8 @@ push_fail_stack (fs, str_idx, dests, nregs, regs, eps_via_nodes)
   fs->stack[num].idx = str_idx;
   fs->stack[num].node = dests[1];
   fs->stack[num].regs = re_malloc (regmatch_t, nregs);
+  if (fs->stack[num].regs == NULL)
+    return REG_ESPACE;
   memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
   err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
   return err;