File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,10 +191,7 @@ class Parser : public Firebird::PermanentStorage
191191private:
192192 template <typename T> T* setupNode (Node* node)
193193 {
194- // Get line/column from YYPOSNARG(1)
195- const int posnArg = 1 ;
196- node->line = ((yyps->psp )[1 - yym + posnArg - 1 ]).firstLine ;
197- node->column = ((yyps->psp )[1 - yym + posnArg - 1 ]).firstColumn ;
194+ setNodeLineColumn (node);
198195 return static_cast <T*>(node);
199196 }
200197
@@ -339,6 +336,8 @@ class Parser : public Firebird::PermanentStorage
339336 void yyMoreStack (yyparsestate* yyps);
340337 yyparsestate* yyNewState (int size);
341338
339+ void setNodeLineColumn (Node* node);
340+
342341private:
343342 int parseAux ();
344343 int yylex1 ();
Original file line number Diff line number Diff line change @@ -179,6 +179,17 @@ void Parser::yyFreeState(Parser::yyparsestate* p)
179179}
180180
181181
182+ void Parser::setNodeLineColumn(Node* node)
183+ {
184+ // Check if we are not accessing the position stack below its base.
185+ if (&YYPOSNARG(1) >= yyps->ps)
186+ {
187+ node->line = YYPOSNARG(1).firstLine;
188+ node->column = YYPOSNARG(1).firstColumn;
189+ }
190+ }
191+
192+
182193int Parser::parseAux()
183194{
184195 // ASF: yym moved to Parser.h
You can’t perform that action at this time.
0 commit comments