From 2a6d26db77e238a558650dbb407e6d5c47beb6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 25 Mar 1998 16:51:37 -0800 Subject: [PATCH] bugfix! Rev: src/pike_types.c:1.36 Rev: src/pike_types.h:1.10 --- src/pike_types.c | 49 +++++++++++++++++++++++++++++++++++------------- src/pike_types.h | 1 + 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/pike_types.c b/src/pike_types.c index a493100bdd..0064cea231 100644 --- a/src/pike_types.c +++ b/src/pike_types.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: pike_types.c,v 1.35 1998/03/02 16:06:59 hubbe Exp $"); +RCSID("$Id: pike_types.c,v 1.36 1998/03/26 00:51:37 hubbe Exp $"); #include <ctype.h> #include "svalue.h" #include "pike_types.h" @@ -247,22 +247,37 @@ void push_unfinished_type(char *s) static void push_unfinished_type_with_markers(char *s, struct pike_string **am) { - int e; - e=type_length(s); - for(e--;e>=0;e--) + int e,c,len=type_length(s); + type_stack_mark(); + for(e=0;e<len;e++) { - if(s[e]>='0' && s[e]<='9') + switch(c=EXTRACT_UCHAR(s+e)) { - if(am[s[e]-'0']) - { - push_finished_type(am[s[e]-'0']); - }else{ - push_type(T_MIXED); - } - }else{ - push_type(s[e]); +#if 1 + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + if(am[c-'0']) + { + push_finished_type_backwards(am[c-'0']); + }else{ + push_type(T_MIXED); + } + break; +#endif + + case T_OBJECT: + push_type(c); + push_type(EXTRACT_UCHAR(s+ ++e)); + push_type(EXTRACT_UCHAR(s+ ++e)); + push_type(EXTRACT_UCHAR(s+ ++e)); + push_type(EXTRACT_UCHAR(s+ ++e)); + break; + + default: + push_type(c); } } + type_stack_reverse(); } void push_finished_type(struct pike_string *type) @@ -272,6 +287,14 @@ void push_finished_type(struct pike_string *type) for(e=type->len-1;e>=0;e--) push_type(type->str[e]); } +void push_finished_type_backwards(struct pike_string *type) +{ + int e; + CHECK_TYPE(type); + MEMCPY(type_stackp, type->str, type->len); + type_stackp+=type->len; +} + struct pike_string *debug_pop_unfinished_type(void) { int len,e; diff --git a/src/pike_types.h b/src/pike_types.h index 1f184c9071..311edd637b 100644 --- a/src/pike_types.h +++ b/src/pike_types.h @@ -69,6 +69,7 @@ void type_stack_reverse(void); void push_type_int(unsigned INT32 i); void push_unfinished_type(char *s); void push_finished_type(struct pike_string *type); +void push_finished_type_backwards(struct pike_string *type); struct pike_string *debug_pop_unfinished_type(void); struct pike_string *debug_pop_type(void); struct pike_string *parse_type(char *s); -- GitLab