pike.git / src / OCPikeInterpreter.m

version» Context lines:

pike.git/src/OCPikeInterpreter.m:139:    {    num=throw_value.u.integer;    }else{    if (throw_value.type == T_OBJECT &&    throw_value.u.object->prog == master_load_error_program &&    !get_master()) {    /* Report this specific error in a nice way. Since there's no    * master it'd be reported with a raw error dump otherwise. */    struct generic_error_struct *err;    -  dynamic_buffer buf; -  dynbuf_string s; +  byte_buffer buf = BUFFER_INIT();    struct svalue t;       move_svalue (Pike_sp++, &throw_value);    mark_free_svalue (&throw_value); -  err = (struct generic_error_struct *) -  get_storage (Pike_sp[-1].u.object, generic_error_program); +  err = get_storage (Pike_sp[-1].u.object, generic_error_program);       t.type = PIKE_T_STRING;    t.u.string = err->error_message;    -  init_buf(&buf); -  describe_svalue(&t,0,0); -  s=complex_free_buf(&buf); +  describe_svalue(&buf,&t,0,0);    -  fputs(s.str, stderr); -  free(s.str); +  fputs(buffer_get_string(&buf), stderr); +  buffer_free(&buf);    }    else    call_handle_error();    }    }else{          if ((m = load_pike_master())) {    back.severity=THROW_EXIT; - // pike_push_argv(argc, argv); - #if 0 -  // Ok, I've no idea how this is supposed to work since I -  // can't find the actual _main call anywhere, but it -  // does not expect to receive an environment array -  // anymore. /mast -  pike_push_env(); - #endif -  +     }    return YES;   }    return NO;   }      - (BOOL)stopInterpreter   {    UNSETJMP(jmploc);    pike_do_exit(0);    return YES;   }      - (struct program *)compileString: (id)code   {    struct program * p = NULL; -  push_text([code UTF8String]); +  push_static_text([code UTF8String]);    f_utf8_to_string(1);    f_compile(1);    if(Pike_sp[-1].type==T_PROGRAM)    {    p = Pike_sp[-1].u.program;    add_ref(p);    }    pop_n_elems(1);    return p;   }
pike.git/src/OCPikeInterpreter.m:225:    [c setString: @"mixed foo(){ return("];    [c appendString: expression];    [c appendString: @");}"];       p = [self compileString: c];       if(!p) return NULL;       i=find_identifier("foo", p);    -  o = low_clone(p); +  o = fast_clone_object(p);       apply_low(o, i, 0);       s = malloc(sizeof(struct svalue));       if(!s)    {    printf("unable to allocate svalue!\n");    }