From cdbc19060fafebc407189e19c103826abad981a4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 23 Jan 2019 10:20:20 +0100 Subject: [PATCH] Update qxmlstream.g with changes from qxmlstream_p.h Some updates that made it into qxmlstream_p.h have not been reflected in qxmlstream.g. Also fix the expected amount of shift/reduce conflicts. Fixes: QTBUG-60186 Change-Id: I2a5e1c579dbbe8812a75ca6bb1e3a6a0ba909cdf Reviewed-by: Simon Hausmann Reviewed-by: Thiago Macieira --- src/corelib/serialization/qxmlstream.g | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g index 10bfcd491c..e6328a11ac 100644 --- a/src/corelib/serialization/qxmlstream.g +++ b/src/corelib/serialization/qxmlstream.g @@ -41,6 +41,8 @@ %merged_output qxmlstream_p.h +%expect 4 + %token NOTOKEN %token SPACE " " %token LANGLE "<" @@ -144,7 +146,12 @@ %start document + + /. + +#include + template class QXmlStreamSimpleStack { T *data; int tos, cap; @@ -155,7 +162,8 @@ public: inline void reserve(int extraCapacity) { if (tos + extraCapacity + 1 > cap) { cap = qMax(tos + extraCapacity + 1, cap << 1 ); - data = reinterpret_cast(realloc(data, cap * sizeof(T))); + void *ptr = realloc(static_cast(data), cap * sizeof(T)); + data = reinterpret_cast(ptr); Q_CHECK_PTR(data); } } @@ -753,7 +761,7 @@ bool QXmlStreamReaderPrivate::parse() state_stack[tos] = 0; return true; } else if (act > 0) { - if (++tos == stack_size-1) + if (++tos >= stack_size-1) reallocateStack(); Value &val = sym_stack[tos]; @@ -890,7 +898,7 @@ doctype_decl ::= langle_bang DOCTYPE qname markup space_opt RANGLE; /. case $rule_number: dtdName = symString(3); - // fall through + Q_FALLTHROUGH(); ./ doctype_decl ::= doctype_decl_start external_id space_opt markup space_opt RANGLE; /.