* value.h (COERCE_ARRAY): Don't coerce enums.

(COERCE_ENUM):  Don't COERCE_REF.
	(COERCE_NUMBER):  New macro (same as COERCE_ARRAY then COERCE_ENUM).
	* valops.c (value_assign):  Only do COERCE_ARRAY if internalvar (let
 	value_cast handle it otherwise); do *not* COERCE_ENUM either way.
	* valarith.c:  Use COERCE_NUMBER instead od COEREC_ARRAY.
	Add COERCE_REF before COERCE_ENUM.
	* values.c (value_as_long):  Simplify.
This fixes PR chill/8869.
	* valops.c (value_array):  Create internalvar if !c_style_arrays.
This commit is contained in:
Per Bothner
1996-01-24 00:35:09 +00:00
parent a4ff5d3332
commit 533bda7704
2 changed files with 12 additions and 2 deletions

View File

@@ -556,8 +556,7 @@ value_as_long (val)
/* This coerces arrays and functions, which is necessary (e.g.
in disassemble_command). It also dereferences references, which
I suspect is the most logical thing to do. */
if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_ENUM)
COERCE_ARRAY (val);
COERCE_ARRAY (val);
return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val));
}