11, // yagl_glsl_pp_op_bit_not
11, // yagl_glsl_pp_op_negative
11, // yagl_glsl_pp_op_positive
- 11, // yagl_glsl_pp_op_defined
+ 12, // yagl_glsl_pp_op_defined
0, // yagl_glsl_pp_op_par_open - lowest priority because of special handling
0, // yagl_glsl_pp_op_par_close - lowest priority because of special handling
};
}
// move higher or equal priority operations to expression stack
- while (state->pp_current_op > 0 &&
+ while (state->pp_current_op > 0 && state->pp_current_expr > 0 &&
glsl_pp_op_prio[op] <= glsl_pp_op_prio[state->pp_ops[state->pp_current_op - 1]]) {
assert(state->pp_current_expr < YAGL_GLSL_PP_EXPRESSION_STACK_SIZE);
state->pp_current_op--;
assert(state->pp_condition_parse_started);
// empty op stack into expression stack
- while (state->pp_current_op > 0) {
+ while (state->pp_current_op > 0 && state->pp_current_expr > 0) {
assert(state->pp_current_expr < YAGL_GLSL_PP_EXPRESSION_STACK_SIZE);
state->pp_current_op--;
state->pp_exprs[state->pp_current_expr].op = state->pp_ops[state->pp_current_op];