pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:369:    PIKEVAR mapping(string:object(define)) defines flags ID_PRIVATE|ID_PROTECTED;    PIKEVAR int current_line;    PIKEVAR int compile_errors;    PIKEVAR string current_file;    PIKEVAR string charset;    CVAR struct string_builder buf;    PIKEVAR object handler;    PIKEVAR object compat_handler;    PIKEVAR int compat_major;    PIKEVAR int compat_minor; -  /* NB: data is marked private to ensure that pike level code can't -  * remove its references while we hold pointers into it. -  */ -  PIKEVAR string data flags ID_PRIVATE|ID_PROTECTED; +     PIKEVAR string prefix;    PIKEVAR int picky_cpp;    PIKEVAR int keep_comments;    PIKEVAR int dependencies_fail;    PIKEVAR int auto_convert;       PIKEVAR mapping(string:function(string:string)) directives flags ID_PROTECTED;       INIT    {
pike.git/src/cpp.cmod:5200:    }    mapping_string_insert(this->defines, def->name, Pike_sp-1);    pop_stack();    }    else    add_define (this, k->ind.u.string, empty_pike_string);    }    free_mapping (predefs);    }    -  this->data = data; -  add_ref(data); -  +     if (this->charset) { -  push_string(data); -  this->data = data = NULL; +  ref_push_string(data);    ref_push_string(this->charset);    if (!safe_apply_handler ("decode_charset", this->handler,    this->compat_handler, 2, BIT_STRING)) {    cpp_handle_exception (this, "Error decoding with charset %S",    THIS->charset);    Pike_error("Unknown charset.\n");    } -  this->data = data = Pike_sp[-1].u.string; -  Pike_sp--; -  dmalloc_touch_svalue(Pike_sp); +  data = Pike_sp[-1].u.string; +  /* NB: We let the stack hold the references to data. +  * We don't need to keep track of the number of elements +  * on the stack as we have the save_sp marker. +  */    }       if (this->auto_convert && (!data->size_shift) && (data->len > 1)) {    /* Try to determine if we need to recode the string */ -  struct pike_string *new_data = recode_string(this, data); -  free_string(data); -  this->data = data = new_data; +  data = recode_string(this, data); +  push_string(data); +  /* NB: We let the stack hold the references to data. +  * We don't need to keep track of the number of elements +  * on the stack as we have the save_sp marker. +  */    }    if (data->size_shift) {    /* Get rid of any byte order marks (0xfeff) */ -  struct pike_string *new_data = filter_bom(data); -  free_string(data); -  this->data = data = new_data; +  data = filter_bom(data); +  push_string(data); +  /* NB: We let the stack hold the references to data. +  * We don't need to keep track of the number of elements +  * on the stack as we have the save_sp marker. +  */    }       string_builder_binary_strcat(&this->buf, "#line 1 ", 8);    PUSH_STRING_SHIFT(this->current_file->str, this->current_file->len,    this->current_file->size_shift, &this->buf);    string_builder_putchar(&this->buf, '\n');      #ifdef PIKE_DEBUG    SET_ONERROR(tmp, fatal_on_error, "Preprocessor exited with longjump!\n");   #endif /* PIKE_DEBUG */