summaryrefslogtreecommitdiff
path: root/src/mesa/shader/grammar/grammar.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-05-18 14:14:12 -0700
committerEric Anholt <eric@anholt.net>2007-05-18 14:14:12 -0700
commit1bdee1853627e08894bd267b8f0ec176a1b5978f (patch)
tree78c3b8bb81e866de4544d2621abb633b008095ab /src/mesa/shader/grammar/grammar.c
parentc085e350df593ab2af60f53b86265db4c3eab38a (diff)
parent4fca6bfa5d211a093c54b0bbeadaa38081e8c141 (diff)
Merge branch 'master' into i915-unification
Conflicts: src/mesa/drivers/dri/common/dri_bufmgr.c src/mesa/drivers/dri/common/dri_drmpool.c src/mesa/drivers/dri/i915tex/intel_batchpool.c src/mesa/drivers/dri/i915tex/intel_buffer_objects.c src/mesa/drivers/dri/i915tex/intel_regions.c src/mesa/drivers/dri/i915tex/intel_screen.c src/mesa/drivers/dri/i915tex/intel_screen.h
Diffstat (limited to 'src/mesa/shader/grammar/grammar.c')
-rw-r--r--src/mesa/shader/grammar/grammar.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c
index 989e954491..a9775961d3 100644
--- a/src/mesa/shader/grammar/grammar.c
+++ b/src/mesa/shader/grammar/grammar.c
@@ -2693,14 +2693,16 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool
if (status == mr_matched)
{
- if (sp->m_emits != NULL)
- if (emit_push (sp->m_emits, _BP->_F + _P, text[ind - 1], save_ind, &ctx))
+ if (sp->m_emits != NULL) {
+ const byte ch = (ind <= 0) ? 0 : text[ind - 1];
+ if (emit_push (sp->m_emits, _BP->_F + _P, ch, save_ind, &ctx))
{
free_regbyte_ctx_stack (ctx, *rbc);
return mr_internal_error;
}
- _P = _P2;
+ }
+ _P = _P2;
}
/* if the rule operator is a logical or, we pick up the first matching specifier */