diff options
author | Wu Zhou <woodzltc@cn.ibm.com> | 2005-07-06 06:52:25 +0000 |
---|---|---|
committer | Wu Zhou <woodzltc@cn.ibm.com> | 2005-07-06 06:52:25 +0000 |
commit | 2c961d6cc67e2be4920cb748c69f73be98650173 (patch) | |
tree | b5663f01a4d54ce582c970d11ffd0538f01e4371 /gdb/valarith.c | |
parent | 480f62fa7bbf7146d1c11d4459206ef96de032b7 (diff) | |
download | gdb-2c961d6cc67e2be4920cb748c69f73be98650173.tar.gz |
* f-exp.y (yyparse): Add code to support exponentiation expression.
(yylex): Add code to scan exponentiation operator.
* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
* valarith.c (value_binop): Reset errno to 0 before calling pow
to do exponentiation operation.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r-- | gdb/valarith.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c index 54a7fc60df6..ef03fb9839c 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -791,11 +791,12 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) v = v1 / v2; break; - case BINOP_EXP: - v = pow (v1, v2); - if (errno) - error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); - break; + case BINOP_EXP: + errno = 0; + v = pow (v1, v2); + if (errno) + error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); + break; default: error (_("Integer-only operation on floating point number.")); @@ -929,11 +930,12 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) v = v1 / v2; break; - case BINOP_EXP: - v = pow (v1, v2); - if (errno) - error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); - break; + case BINOP_EXP: + errno = 0; + v = pow (v1, v2); + if (errno) + error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); + break; case BINOP_REM: v = v1 % v2; @@ -1050,10 +1052,11 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) error (_("Division by zero")); break; - case BINOP_EXP: - v = pow (v1, v2); - if (errno) - error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); + case BINOP_EXP: + errno = 0; + v = pow (v1, v2); + if (errno) + error (_("Cannot perform exponentiation: %s"), safe_strerror (errno)); break; case BINOP_REM: |