pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: opcodes.c,v 1.131 2004/09/20 12:11:25 mast Exp $ + || $Id: opcodes.c,v 1.132 2005/08/08 09:44:06 jonasw Exp $   */      #include "global.h"   #include <errno.h>   #include <math.h>   #include <ctype.h>   #include "interpret.h"   #include "svalue.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/opcodes.c:23:   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"      #define sp Pike_sp    - RCSID("$Id: opcodes.c,v 1.131 2004/09/20 12:11:25 mast Exp $"); + RCSID("$Id: opcodes.c,v 1.132 2005/08/08 09:44:06 jonasw Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:1490:    \    case 's': \    if(field_length != -1) \    { \    if(input_len - eye < field_length) \    { \    chars_matched[0]=eye; \    return matches; \    } \    \ -  sval.type=T_STRING; \ +  if (no_assign) { \ +  no_assign = 2; \ +  } else { \ +  sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \    sval.u.string=PIKE_CONCAT(make_shared_binary_string, \    INPUT_SHIFT)(input+eye, \    field_length); \ -  +  } \    eye+=field_length; \    break; \    } \    \    if(cnt+1>=match_len) \    { \ -  sval.type=T_STRING; \ +  if (no_assign) { \ +  no_assign = 2; \ +  } else { \ +  sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \    sval.u.string=PIKE_CONCAT(make_shared_binary_string, \    INPUT_SHIFT)(input+eye, \    input_len-eye); \ -  +  } \    eye=input_len; \    break; \    }else{ \    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *end_str_start; \    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *end_str_end; \    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *s=0; \    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *p=0; \    int contains_percent_percent; \    ptrdiff_t start, new_eye; \    \
pike.git/src/opcodes.c:1604:    e++; \    }else{ \    break; \    } \    } \    } \    \    end_str_end=match+e; \    \    if (end_str_end == end_str_start) { \ +  if (no_assign) { \ +  no_assign = 2; \ +  } else { \    sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \    sval.u.string=PIKE_CONCAT(make_shared_binary_string, \ -  INPUT_SHIFT)(input+eye, \ +  INPUT_SHIFT)(input+eye, \    input_len-eye); \ -  +  } \    eye=input_len; \    break; \    } else if(!contains_percent_percent) \    { \    struct generic_mem_searcher searcher; \    PIKE_CONCAT(p_wchar, INPUT_SHIFT) *s2; \    init_generic_memsearcher(&searcher, end_str_start, \    end_str_end - end_str_start, \    MATCH_SHIFT, input_len - eye, \    INPUT_SHIFT); \
pike.git/src/opcodes.c:1649:    break; \    } \    if(eye==input_len) \    { \    chars_matched[0]=eye; \    return matches; \    } \    new_eye=p2-input; \    } \    \ -  sval.type=T_STRING; \ +  if (no_assign) { \ +  no_assign = 2; \ +  } else { \ +  sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \    sval.u.string=PIKE_CONCAT(make_shared_binary_string, \ -  INPUT_SHIFT)(input+start, \ -  eye-start); \ +  INPUT_SHIFT)(input+start, \ +  eye-start); \ +  } \    \    cnt=end_str_end-match-1; \    eye=new_eye; \    break; \    } \    \    case '[': \    cnt=PIKE_CONCAT(read_set,MATCH_SHIFT)(match,cnt+1, \    &set,match_len); \    \
pike.git/src/opcodes.c:1690:    tmp.u.integer=input[eye]; \    x=switch_lookup(set.a, &tmp); \    if( set.neg != (x<0 && (x&1)) ) break; \    }else{ \    if(!set.neg) break; \    } \    } \   ) \    } \    if(set.a) { free_array(set.a); set.a=0; } \ +  if (no_assign) { \ +  no_assign = 2; \ +  } else { \    sval.type=T_STRING; \    DO_IF_CHECKER(sval.subtype=0); \ -  sval.u.string=PIKE_CONCAT(make_shared_binary_string, \ +  sval.u.string=PIKE_CONCAT(make_shared_binary_string, \    INPUT_SHIFT)(input+e,eye-e); \ -  +  } \    break; \    \    case 'n': \    sval.type=T_INT; \    sval.subtype=NUMBER_NUMBER; \    sval.u.integer=TO_INT32(eye); \    break; \    \    default: \ -  Pike_error("Unknown sscanf token %%%c(0x%02x)\n", \ +  Pike_error("Unknown sscanf token %%%c(0x%02x)\n", \    match[cnt], match[cnt]); \    } \    break; \    } \    matches++; \    \    if(no_assign) \    { \ -  +  if (no_assign == 1) \    free_svalue(&sval); \ -  }else{ \ +  } else { \    check_stack(1); \    *sp++=sval; \    DO_IF_DEBUG(sval.type=99); \    } \    } \    chars_matched[0]=eye; \    success[0]=1; \    return matches; \   }