libtasn1-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libtasn1 branch, master, updated. libtasn1_4.7-13-g80accf6


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4.7-13-g80accf6
Date: Sun, 03 Apr 2016 09:38:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=80accf6e21259e2f97e62dc6d557f47ad6f695fc

The branch, master has been updated
       via  80accf6e21259e2f97e62dc6d557f47ad6f695fc (commit)
       via  62cb6fab75ee9a4fc2925104896980d40862a89f (commit)
      from  56b9f13cff50861bc0660dcf5b8d4a41c2bd5289 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 80accf6e21259e2f97e62dc6d557f47ad6f695fc
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Apr 3 11:37:10 2016 +0200

    fixed incorrect parameter to _asn1_append_sequence_set()
    
    This was uncovered by the previous revert, and seemed working
    due to the optimization semantics.

commit 62cb6fab75ee9a4fc2925104896980d40862a89f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Apr 3 10:10:49 2016 +0200

    Revert "optimized _asn1_find_up()."
    
    This reverts commit 4010bb04588fca86a9f6d683b637c05b4cec24e0.
    This optimization did not offer much benefit and there may be
    corner cases in the internal structure handling that may not
    be possibly to handle with this optimization.

-----------------------------------------------------------------------

Summary of changes:
 lib/coding.c     |    4 ++--
 lib/decoding.c   |   22 +++++++++++-----------
 lib/element.c    |   11 +++++++----
 lib/int.h        |    1 -
 lib/parser_aux.c |   18 +++++++-----------
 lib/parser_aux.h |   13 +------------
 lib/structure.c  |   22 +++++++++++-----------
 7 files changed, 39 insertions(+), 52 deletions(-)

diff --git a/lib/coding.c b/lib/coding.c
index 78615a1..0c0f69c 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -1253,7 +1253,7 @@ asn1_der_coding (asn1_node element, const char *name, 
void *ider, int *len,
                  continue;
                }
              else
-               p = _asn1_get_up (p);
+               p = _asn1_find_up (p);
              move = UP;
            }
          if (move == UP)
@@ -1328,7 +1328,7 @@ asn1_der_coding (asn1_node element, const char *name, 
void *ider, int *len,
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   *len = counter;
diff --git a/lib/decoding.c b/lib/decoding.c
index caf1eb4..69050fd 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -710,7 +710,7 @@ _asn1_delete_not_used (asn1_node node)
            {
              p2 = _asn1_find_left (p);
              if (!p2)
-               p2 = _asn1_get_up (p);
+               p2 = _asn1_find_up (p);
            }
          asn1_delete_structure (&p);
          p = p2;
@@ -733,7 +733,7 @@ _asn1_delete_not_used (asn1_node node)
            {
              while (1)
                {
-                 p = _asn1_get_up (p);
+                 p = _asn1_find_up (p);
                  if (p == node)
                    {
                      p = NULL;
@@ -1050,7 +1050,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
        {
          if (p->type & CONST_SET)
            {
-             p2 = _asn1_get_up (p);
+             p2 = _asn1_find_up (p);
              len2 = p2->tmp_ival;
              if (len2 == -1)
                {
@@ -1106,7 +1106,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
 
          if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
            {
-             p2 = _asn1_get_up (p);
+             p2 = _asn1_find_up (p);
              len2 = p2->tmp_ival;
              if (counter == len2)
                {
@@ -1169,7 +1169,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
 
          if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
            {
-             p2 = _asn1_get_up (p);
+             p2 = _asn1_find_up (p);
              len2 = p2->tmp_ival;
 
              if ((len2 != -1) && (counter > len2))
@@ -1481,7 +1481,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
                             || (type_field (p2->type) == ASN1_ETYPE_SIZE))
                        p2 = p2->right;
                      if (p2->right == NULL)
-                       _asn1_append_sequence_set (p, &ptail);
+                       _asn1_append_sequence_set (p, NULL);
                      p = p2;
                    }
                }
@@ -1597,7 +1597,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, 
int *max_ider_len,
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   _asn1_delete_not_used (*element);
@@ -1810,7 +1810,7 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
                  break;
                }
 
-             p3 = _asn1_get_up (p);
+             p3 = _asn1_find_up (p);
 
              if (!p3)
                {
@@ -1830,8 +1830,8 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
                  (p3->value == NULL))
                {
 
-                 p3 = _asn1_get_up (p);
-                 p3 = _asn1_get_up (p3);
+                 p3 = _asn1_find_up (p);
+                 p3 = _asn1_find_up (p3);
 
                  if (!p3)
                    {
@@ -1966,7 +1966,7 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
        {
          while (1)
            {
-             p = _asn1_get_up (p);
+             p = _asn1_find_up (p);
              if (p == *element)
                {
                  p = NULL;
diff --git a/lib/element.c b/lib/element.c
index 321302a..7976285 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -52,7 +52,7 @@ _asn1_hierarchical_name (asn1_node node, char *name, int 
name_size)
          _asn1_str_cat (name, name_size, ".");
          _asn1_str_cat (name, name_size, tmp_name);
        }
-      p = _asn1_get_up (p);
+      p = _asn1_find_up (p);
     }
 
   if (name[0] == 0)
@@ -154,9 +154,12 @@ _asn1_append_sequence_set (asn1_node node, asn1_node 
*ptail)
     p = p->right;
   p2 = _asn1_copy_structure3 (p);
 
-  if (ptail == NULL || *ptail == NULL || (*ptail)->up != p->up)
-    while (p->right) {
-      p = p->right;
+  if (ptail == NULL || *ptail == NULL)
+    {
+      while (p->right)
+        {
+          p = p->right;
+        }
     }
   else
     {
diff --git a/lib/int.h b/lib/int.h
index ee870c7..322b80f 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -51,7 +51,6 @@ struct asn1_node_st
   unsigned int type;           /* Node type */
   unsigned char *value;                /* Node value */
   int value_len;
-  asn1_node up;                        /* Pointer to the parent node */
   asn1_node down;              /* Pointer to the son node */
   asn1_node right;             /* Pointer to the brother node */
   asn1_node left;              /* Pointer to the next list element */
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index da9a388..8e85bf8 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -425,11 +425,7 @@ _asn1_set_right (asn1_node node, asn1_node right)
     return node;
   node->right = right;
   if (right)
-    {
-      right->left = node;
-      if (right->up == NULL)
-        right->up = node->up;
-    }
+    right->left = node;
   return node;
 }
 
@@ -625,7 +621,7 @@ _asn1_change_integer_value (asn1_node node)
            {
              while (1)
                {
-                 p = _asn1_get_up (p);
+                 p = _asn1_find_up (p);
                  if (p == node)
                    {
                      p = NULL;
@@ -753,7 +749,7 @@ _asn1_expand_object_id (asn1_node node)
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
 
@@ -825,7 +821,7 @@ _asn1_expand_object_id (asn1_node node)
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   return ASN1_SUCCESS;
@@ -895,7 +891,7 @@ _asn1_type_set_config (asn1_node node)
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   return ASN1_SUCCESS;
@@ -992,7 +988,7 @@ _asn1_check_identifier (asn1_node node)
        {
          while (1)
            {
-             p = _asn1_get_up (p);
+             p = _asn1_find_up (p);
              if (p == node)
                {
                  p = NULL;
@@ -1052,7 +1048,7 @@ _asn1_set_default_tag (asn1_node node)
        {
          while (1)
            {
-             p = _asn1_get_up (p);
+             p = _asn1_find_up (p);
              if (p == node)
                {
                  p = NULL;
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
index 437f1c8..10b864b 100644
--- a/lib/parser_aux.h
+++ b/lib/parser_aux.h
@@ -58,14 +58,6 @@ char *_asn1_ltostr (long v, char str[LTOSTR_MAX_SIZE]);
 
 asn1_node _asn1_find_up (asn1_node node);
 
-inline static asn1_node _asn1_get_up(asn1_node node)
-{
-       if (node && node->up)
-               return node->up;
-       else
-               return _asn1_find_up(node);
-}
-
 int _asn1_change_integer_value (asn1_node node);
 
 int _asn1_expand_object_id (asn1_node node);
@@ -108,10 +100,7 @@ _asn1_set_down (asn1_node node, asn1_node down)
     return node;
   node->down = down;
   if (down)
-    {
-      down->left = node;
-      down->up = node;
-    }
+    down->left = node;
   return node;
 }
 
diff --git a/lib/structure.c b/lib/structure.c
index fc33547..01715b1 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -134,7 +134,7 @@ _asn1_create_static_structure (asn1_node pointer, char 
*output_file_name,
        {
          while (1)
            {
-             p = _asn1_get_up (p);
+             p = _asn1_find_up (p);
              if (p == pointer)
                {
                  p = NULL;
@@ -223,7 +223,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node 
* definitions,
              if (p_last == *definitions)
                break;
 
-             p_last = _asn1_get_up (p_last);
+             p_last = _asn1_find_up (p_last);
 
              if (p_last == NULL)
                break;
@@ -323,7 +323,7 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int 
flags)
          p2 = p->right;
          if (p != *structure)
            {
-             p3 = _asn1_get_up (p);
+             p3 = _asn1_find_up (p);
              _asn1_set_down (p3, p2);
              _asn1_remove_node (p, flags);
              p = p3;
@@ -333,7 +333,7 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int 
flags)
              p3 = _asn1_find_left (p);
              if (!p3)
                {
-                 p3 = _asn1_get_up (p);
+                 p3 = _asn1_find_up (p);
                  if (p3)
                    _asn1_set_down (p3, p2);
                  else
@@ -381,7 +381,7 @@ asn1_delete_element (asn1_node structure, const char 
*element_name)
   p3 = _asn1_find_left (source_node);
   if (!p3)
     {
-      p3 = _asn1_get_up (source_node);
+      p3 = _asn1_find_up (source_node);
       if (p3)
        _asn1_set_down (p3, p2);
       else if (source_node->right)
@@ -443,8 +443,8 @@ _asn1_copy_structure3 (asn1_node source_node)
       else
        {
          move = UP;
-         p_s = _asn1_get_up (p_s);
-         p_d = _asn1_get_up (p_d);
+         p_s = _asn1_find_up (p_s);
+         p_d = _asn1_find_up (p_d);
        }
     }
   while (p_s != source_node);
@@ -544,7 +544,7 @@ _asn1_type_choice_config (asn1_node node)
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   return ASN1_SUCCESS;
@@ -595,7 +595,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root)
                _asn1_set_right (p3, p2);
              else
                {
-                 p3 = _asn1_get_up (p);
+                 p3 = _asn1_find_up (p);
                  if (p3)
                    _asn1_set_down (p3, p2);
                  else
@@ -651,7 +651,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root)
            move = UP;
        }
       if (move == UP)
-       p = _asn1_get_up (p);
+       p = _asn1_find_up (p);
     }
 
   return ASN1_SUCCESS;
@@ -1019,7 +1019,7 @@ asn1_print_structure (FILE * out, asn1_node structure, 
const char *name,
        {
          while (1)
            {
-             p = _asn1_get_up (p);
+             p = _asn1_find_up (p);
              if (p == root)
                {
                  p = NULL;


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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