aboutsummaryrefslogtreecommitdiff
path: root/gcc/m2/gm2spec.cc
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2024-07-16 15:27:21 +0100
committerGaius Mulley <gaiusmod2@gmail.com>2024-07-16 15:27:21 +0100
commitd9709fafb2c498ba2f4c920f953c9b78fa3bf114 (patch)
tree8ff6e117c7380613598921f7833c8c30f1f2ddcc /gcc/m2/gm2spec.cc
parent616627245fb06106f7c5bc4a36784acc8ec166f0 (diff)
downloadgcc-d9709fafb2c498ba2f4c920f953c9b78fa3bf114.zip
gcc-d9709fafb2c498ba2f4c920f953c9b78fa3bf114.tar.gz
gcc-d9709fafb2c498ba2f4c920f953c9b78fa3bf114.tar.bz2
PR modula2/115957 ICE on procedure local const declaration
An ICE would occur if a constant was declared using a variable term. This fix catches variable terms in constant expressions and generates an unrecoverable error. gcc/m2/ChangeLog: PR modula2/115957 * gm2-compiler/M2StackAddress.mod (PopAddress): Detect tail=NIL and generate an internal error. * gm2-compiler/PCBuild.bnf (InConstParameter): New variable. (InConstBlock): New variable. (ErrorString): Rewrite using MetaErrorStringT0. (ErrorArrayAt): Rewrite using MetaErrorStringT0. (WarnMissingToken): Use MetaErrorStringT0. (CompilationUnit): Set seenError FALSE. (init): Initialize InConstParameter and InConstBlock. (ConstantDeclaration): Set InConstBlock. (ConstSetOrQualidentOrFunction): Call CheckNotVar if not InConstParameter and InConstBlock. (ConstActualParameters): Set InConstParameter TRUE and restore value at the end. * gm2-compiler/PCSymBuild.def (CheckNotVar): New procedure. Remove all unnecessary export qualified list. * gm2-compiler/PCSymBuild.mod (CheckNotVar): New procedure. gcc/testsuite/ChangeLog: PR modula2/115957 * gm2/errors/fail/badconst.mod: New test. * gm2/pim/fail/tinyadr.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/m2/gm2spec.cc')
0 files changed, 0 insertions, 0 deletions