aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y16
1 files changed, 10 insertions, 6 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 02dc36f..3998d2b 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -82,7 +82,7 @@ static int number_sign = 1;
{
LONGEST lval;
ULONGEST ulval;
- DOUBLEST dval;
+ gdb_byte val[16];
struct symbol *sym;
struct type *tval;
struct stoken sval;
@@ -103,7 +103,7 @@ static int number_sign = 1;
%token <lval> INT HEX ERROR
%token <ulval> UINT M2_TRUE M2_FALSE CHAR
-%token <dval> FLOAT
+%token <val> FLOAT
/* Both NAME and TYPENAME tokens represent symbols in the input,
and both convey their data as strings.
@@ -474,12 +474,12 @@ exp : CHAR
exp : FLOAT
- { write_exp_elt_opcode (pstate, OP_DOUBLE);
+ { write_exp_elt_opcode (pstate, OP_FLOAT);
write_exp_elt_type (pstate,
parse_m2_type (pstate)
->builtin_real);
- write_exp_elt_dblcst (pstate, $1);
- write_exp_elt_opcode (pstate, OP_DOUBLE); }
+ write_exp_elt_floatcst (pstate, $1);
+ write_exp_elt_opcode (pstate, OP_FLOAT); }
;
exp : variable
@@ -650,7 +650,11 @@ parse_number (int olen)
if (p[c] == '.' && base == 10)
{
/* It's a float since it contains a point. */
- yylval.dval = atof (p);
+ if (!parse_float (p, len,
+ parse_m2_type (pstate)->builtin_real,
+ yylval.val))
+ return ERROR;
+
lexptr += len;
return FLOAT;
}