Make sure that values of absolute symbols fit in 16 bits.
This commit is contained in:
parent
102617f186
commit
210bd2dd94
|
@ -63,7 +63,7 @@ typedef struct
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int value;
|
unsigned short value;
|
||||||
} ORD_ABS;
|
} ORD_ABS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -355,6 +355,11 @@ static int parse_spec_equate( ORDDEF *odp, DLLSPEC *spec )
|
||||||
error( "Expected number value, got '%s'\n", token );
|
error( "Expected number value, got '%s'\n", token );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (value < -0x8000 || value > 0xffff)
|
||||||
|
{
|
||||||
|
error( "Value %d for absolute symbol doesn't fit in 16 bits\n", value );
|
||||||
|
value = 0;
|
||||||
|
}
|
||||||
odp->u.abs.value = value;
|
odp->u.abs.value = value;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue