diff options
author | Tom Tromey <tom@tromey.com> | 2020-12-11 09:59:15 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-12-11 10:10:53 -0700 |
commit | 02c727013cc3ae08b86ad360429f9a0dbdc0ec92 (patch) | |
tree | a2ab1ef9c1f3d7c441e615f01fd671c135742827 /bfd | |
parent | 14a772212b8e8e19b45a23e2dacb61ceff0d4979 (diff) | |
download | gdb-02c727013cc3ae08b86ad360429f9a0dbdc0ec92.zip gdb-02c727013cc3ae08b86ad360429f9a0dbdc0ec92.tar.gz gdb-02c727013cc3ae08b86ad360429f9a0dbdc0ec92.tar.bz2 |
Avoid side effects in expression lexers
I noticed that some of the lexers were calling write_dollar_variable
from the lexer. This seems like a bad practice, so this patch moves
the side effects into the parsers.
I tested this by re-running gdb.fortran and gdb.modula2; the Pascal
compiler on my machine seems not to work, so I couldn't test
gdb.pascal.
I note that the type-tracking in the Pascal is also incorrect, in that
a convenience variable's type may change between parsing and
evaluation (or even during the course of evaluation).
gdb/ChangeLog
2020-12-11 Tom Tromey <tom@tromey.com>
* p-exp.y (intvar): Remove global.
(DOLLAR_VARIABLE): Change type.
(start): Update.
(exp): Call write_dollar_variable here...
(yylex): ... not here.
* m2-exp.y (DOLLAR_VARIABLE): Change type.
(variable): Call write_dollar_variable here...
(yylex): ... not here.
* f-exp.y (DOLLAR_VARIABLE): Change type.
(exp): Call write_dollar_variable here...
(yylex): ... not here.
Diffstat (limited to 'bfd')
0 files changed, 0 insertions, 0 deletions