pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.654 2008/03/20 15:34:37 grubba Exp $ + || $Id: program.c,v 1.655 2008/03/26 15:07:11 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:5981:       for (i=0;i<Pike_compiler->new_program->num_strings;i++)    if (Pike_compiler->new_program->strings[i] == str)    return i;       reference_shared_string(str);    add_to_strings(str);    return i;   }    + /* NOTE: O(n²)! */   int store_constant(struct svalue *foo,    int equal,    struct pike_string *constant_name)   {    struct program_constant tmp;    volatile unsigned int e;    -  for(e=0;e<Pike_compiler->new_program->num_constants;e++) -  { +     JMP_BUF jmp;    if (SETJMP(jmp)) {    handle_compile_exception ("Error comparing constants.");    /* Assume that if `==() throws an error, the svalues aren't equal. */ -  +  e = Pike_compiler->new_program->num_constants;    } else { -  +  for(e=0;e<Pike_compiler->new_program->num_constants;e++) +  {    struct program_constant *c = Pike_compiler->new_program->constants+e;       if (foo->type == c->sval.type) {    /* Make sure only to compare within the same basic type. */    if (foo->type == T_OBJECT) {    /* Special case objects -- We don't want stange LFUN effects... */    if ((foo->u.object == c->sval.u.object) &&    (foo->subtype == c->sval.subtype)) {    UNSETJMP(jmp);    return e;
pike.git/src/program.c:6019:    UNSETJMP(jmp);    return e;    }    }    } else if(equal ? is_equal(& c->sval,foo) : is_eq(& c->sval,foo)) {    UNSETJMP(jmp);    return e;    }    }    } -  UNSETJMP(jmp); +     } -  +  UNSETJMP(jmp);    assign_svalue_no_free(&tmp.sval,foo);   #if 0    if((tmp.name=constant_name)) add_ref(constant_name);   #else /* !0 */    tmp.offset = -1;   #endif /* 0 */       add_to_constants(tmp);       return e;