mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-25 03:06:11 +08:00
* ada-lang.c (ada_evaluate_subexp) [BINOP_ADD, BINOP_SUB]:
Add special handling for pointer types.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2008-09-10 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
* ada-lang.c (ada_evaluate_subexp) [BINOP_ADD, BINOP_SUB]:
|
||||
Add special handling for pointer types.
|
||||
|
||||
2008-09-10 Pedro Alves <pedro@codesourcery.com>
|
||||
|
||||
* inf-ttrace.c (inf_ttrace_follow_fork): Declare locals at the
|
||||
|
@ -8497,6 +8497,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
if (noside == EVAL_SKIP)
|
||||
goto nosideret;
|
||||
if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_PTR)
|
||||
return (value_from_longest
|
||||
(value_type (arg1),
|
||||
value_as_long (arg1) + value_as_long (arg2)));
|
||||
if ((ada_is_fixed_point_type (value_type (arg1))
|
||||
|| ada_is_fixed_point_type (value_type (arg2)))
|
||||
&& value_type (arg1) != value_type (arg2))
|
||||
@ -8514,6 +8518,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
if (noside == EVAL_SKIP)
|
||||
goto nosideret;
|
||||
if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_PTR)
|
||||
return (value_from_longest
|
||||
(value_type (arg1),
|
||||
value_as_long (arg1) - value_as_long (arg2)));
|
||||
if ((ada_is_fixed_point_type (value_type (arg1))
|
||||
|| ada_is_fixed_point_type (value_type (arg2)))
|
||||
&& value_type (arg1) != value_type (arg2))
|
||||
|
Reference in New Issue
Block a user