Don't check for circular references of imports that don't have matching exports.

This fix will avoid referring to a struct member through a null pointer.
This commit is contained in:
Greg King 2021-06-04 08:49:10 -04:00
parent d5d9183ccf
commit 39ef63cbbc
1 changed files with 3 additions and 5 deletions

View File

@ -457,16 +457,14 @@ long GetExprVal (ExprNode* Expr)
static void GetSegExprValInternal (ExprNode* Expr, SegExprDesc* D, int Sign)
/* Check if the given expression consists of a segment reference and only
** constant values, additions and subtractions. If anything else is found,
** constant values, additions, and subtractions. If anything else is found,
** set D->TooComplex to true.
** Internal, recursive routine.
*/
{
Export* E;
if (Expr == 0) {
return;
}
CHECK (Expr != 0);
switch (Expr->Op) {
@ -483,7 +481,7 @@ static void GetSegExprValInternal (ExprNode* Expr, SegExprDesc* D, int Sign)
*/
if (ExportHasMark (E)) {
CircularRefError (E);
} else {
} else if (E->Expr != 0) {
MarkExport (E);
GetSegExprValInternal (E->Expr, D, Sign);
UnmarkExport (E);