pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:3501:    *    * NB: The arguments (if any) are in an array at the top of the stack,    * and if none there is UNDEFINED.    */   static void apply_define(struct CPP_struct *this,    struct define_struct *d,    short flags,    struct pike_string *charset)   {    struct svalue *save_sp = Pike_sp; -  int save_flags; +  JMP_BUF tmp;       /* Keep d around... */    push_svalue(&d->self);       stack_swap();    -  +  if (!SETJMP(tmp)) {    if ((d->args == 1) && !Pike_sp[-1].u.array->size &&    !(d->flags & CPP_MACRO_VARARGS)) {    // Allow a single argument to be left out.    pop_stack();    ref_push_string(empty_pike_string);    f_aggregate(1);    }    ref_push_object(Pike_fp->current_object);    push_int(flags);    apply_lfun(d->self.u.object, LFUN_CALL, 3);    -  +  UNSETJMP(tmp); +     if (TYPEOF(Pike_sp[-1]) == PIKE_T_STRING) { -  save_flags = d->flags; +  int save_flags = d->flags;    d->flags |= CPP_MACRO_DISABLED;       /* NB: We're executing in the CPP context object. */    low_cpp(this, MKPCHARP_STR(Pike_sp[-1].u.string), Pike_sp[-1].u.string->len,    flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE),    charset);       d->flags = save_flags;    } else {    this->compile_errors++;    } -  +  } else { +  UNSETJMP(tmp);    -  +  this->compile_errors++; +  } +     /* NB: Pop the args array too... */    pop_n_elems(Pike_sp + 1 - save_sp);   }      /*    * Preprocessor template.    *    * NB: There are two basic cases where this function is called:    *    * * Either when switching to a new input data string