#define CURPOSITION() (&buffer->positions[buffer->in_pos])
#define OUT_GLYPH(pos) (buffer->out_string[(pos)].codepoint)
#define OUT_INFO(pos) (&buffer->out_string[(pos)])
+#define BACKTRACK_LEN() ((buffer->have_output? buffer->out_length : buffer->in_pos))
HB_END_DECLS
match_func_t match_func,
char *match_data)
{
- if (HB_UNLIKELY (buffer->out_pos < count))
+ if (HB_UNLIKELY (BACKTRACK_LEN () < count))
return false;
- for (unsigned int i = 0, j = buffer->out_pos - 1; i < count; i++, j--)
+ for (unsigned int i = 0, j = BACKTRACK_LEN () - 1; i < count; i++, j--)
{
while (_hb_ot_layout_skip_mark (context->face, OUT_INFO (j), lookup_flag, NULL))
{
ChainContextLookupContext &lookup_context)
{
/* First guess */
- if (HB_UNLIKELY (buffer->out_pos < backtrackCount ||
+ if (HB_UNLIKELY (BACKTRACK_LEN () < backtrackCount ||
buffer->in_pos + inputCount + lookaheadCount > buffer->in_length ||
inputCount + lookaheadCount > context_length))
return false;