* valops.c (value_assign): Make copy of internal variable value
before returning it as a new value, since it is owned by the internal variable and will be freed along with it.
This commit is contained in:
parent
d0757082eb
commit
75225aa25d
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Mar 28 06:51:26 1996 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
|
* valops.c (value_assign): Make copy of internal variable value
|
||||||
|
before returning it as a new value, since it is owned by the
|
||||||
|
internal variable and will be freed along with it.
|
||||||
|
|
||||||
Wed Mar 27 08:36:17 1996 Jeffrey A Law (law@cygnus.com)
|
Wed Mar 27 08:36:17 1996 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* From Peter Schauer.
|
* From Peter Schauer.
|
||||||
|
|
15
gdb/valops.c
15
gdb/valops.c
|
@ -32,6 +32,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
|
|
||||||
|
/* Default to coercing float to double in function calls only when there is
|
||||||
|
no prototype. Otherwise on targets where the debug information is incorrect
|
||||||
|
for either the prototype or non-prototype case, we can force it by defining
|
||||||
|
COERCE_FLOAT_TO_DOUBLE in the target configuration file. */
|
||||||
|
|
||||||
|
#ifndef COERCE_FLOAT_TO_DOUBLE
|
||||||
|
#define COERCE_FLOAT_TO_DOUBLE (param_type == NULL)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Local functions. */
|
/* Local functions. */
|
||||||
|
|
||||||
static int typecmp PARAMS ((int staticp, struct type *t1[], value_ptr t2[]));
|
static int typecmp PARAMS ((int staticp, struct type *t1[], value_ptr t2[]));
|
||||||
|
@ -440,7 +449,7 @@ value_assign (toval, fromval)
|
||||||
{
|
{
|
||||||
case lval_internalvar:
|
case lval_internalvar:
|
||||||
set_internalvar (VALUE_INTERNALVAR (toval), fromval);
|
set_internalvar (VALUE_INTERNALVAR (toval), fromval);
|
||||||
return VALUE_INTERNALVAR (toval)->value;
|
return value_copy (VALUE_INTERNALVAR (toval)->value);
|
||||||
|
|
||||||
case lval_internalvar_component:
|
case lval_internalvar_component:
|
||||||
set_internalvar_component (VALUE_INTERNALVAR (toval),
|
set_internalvar_component (VALUE_INTERNALVAR (toval),
|
||||||
|
@ -889,9 +898,7 @@ value_arg_coerce (arg, param_type)
|
||||||
break;
|
break;
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
/* coerce float to double, unless the function prototype specifies float */
|
/* coerce float to double, unless the function prototype specifies float */
|
||||||
#if 0
|
if (COERCE_FLOAT_TO_DOUBLE)
|
||||||
if (param_type == 0)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
|
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
|
||||||
type = builtin_type_double;
|
type = builtin_type_double;
|
||||||
|
|
Loading…
Reference in New Issue