]> git.ipfire.org Git - people/ms/gcc.git/commit
Detect errors when dereferencing an undeclared variable.
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 16 Jan 2023 18:09:04 +0000 (18:09 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 16 Jan 2023 18:09:04 +0000 (18:09 +0000)
commita0c595386fa322e1874d33742fc56c6a0c13c4a5
tree09ec7c9ab44797b26648a2ab8c6e037130e253e7
parentb1f30bf42d8d47228e52de998f3172b2f5dd7265
Detect errors when dereferencing an undeclared variable.

Attempting to dereference an undeclared variable will cause an ICE.
Also attempting to pass an undeclared variable as an array of type
will also cause an ICE.  This patch detects both conditions and
generates an appropriate error.

gcc/m2/ChangeLog:

* gm2-compiler/M2Quads.mod (AssignUnboundedVar): Check Type
against NulSym and call MetaErrorT1 if necessary.
(AssignUnboundedNonVar): Check Type against NulSym and
call MetaErrorT1 if necessary.
(BuildDesignatorPointer): Check Type1 against NulSym and
call MetaErrorT1 if necessary.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2Quads.mod