aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m2-lang.c')
-rw-r--r--gdb/m2-lang.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 9ca3ae1..85fa123 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -253,7 +253,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
arg1 = value_cast (type, arg1);
type = check_typedef (value_type (arg1));
- return value_ind (value_ptradd (arg1, arg2));
+ return value_ind (value_ptradd (arg1, value_as_long (arg2)));
}
else
if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
@@ -268,7 +268,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (TYPE_TARGET_TYPE (type), VALUE_LVAL (arg1));
else
- return value_subscript (arg1, arg2);
+ return value_subscript (arg1, value_as_long (arg2));
default:
return evaluate_subexp_standard (expect_type, exp, pos, noside);