Branch: Tag:

2021-05-31

2021-05-31 14:36:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Cpp: Improved handling of not having any defines mapping.

2257:    */   static void undefine(struct CPP_struct *this, struct pike_string *name)   { +  if (!this->defines) return;    ref_push_string(name);    push_int(0);    map_delete_no_free(this->defines, Pike_sp - 2, Pike_sp - 1);
2325:    struct pike_string *orig_name = name;    struct define_struct *def;    +  if (!this->defines) { +  this->defines = allocate_mapping(32); +  } +     if( (name->len > 2) &&    (index_shared_string(name, name->len-1) == ')') &&    (index_shared_string(name, name->len-2) == '(')) {
3562:    INT_TYPE first_line = this->current_line;    /* FIXME: What about this->current_file? */    +  if (!this->defines) { +  this->defines = allocate_mapping(32); +  } +     for(pos=0; pos<len;)    {    ptrdiff_t old_pos = pos;