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 <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Lars Knoll 2019-01-23 10:20:20 +01:00
parent 991c498905
commit cdbc19060f
1 changed files with 11 additions and 3 deletions

View File

@ -41,6 +41,8 @@
%merged_output qxmlstream_p.h
%expect 4
%token NOTOKEN
%token SPACE " "
%token LANGLE "<"
@ -144,7 +146,12 @@
%start document
/.
#include <QtCore/private/qglobal_p.h>
template <typename T> 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<T *>(realloc(data, cap * sizeof(T)));
void *ptr = realloc(static_cast<void *>(data), cap * sizeof(T));
data = reinterpret_cast<T *>(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;
/.