aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-07-08 18:36:19 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-07-08 18:36:19 +0300
commitf34e5c8c66202a4bf58a86799d4efd438ffa1284 (patch)
tree37cab41237e25912cd3de1ff9e78f15f6fb756fd /mpfr.c
parenteead4c7f6e29955a1a9578904a95c6291e8057b5 (diff)
downloadegawk-f34e5c8c66202a4bf58a86799d4efd438ffa1284.tar.gz
egawk-f34e5c8c66202a4bf58a86799d4efd438ffa1284.tar.bz2
egawk-f34e5c8c66202a4bf58a86799d4efd438ffa1284.zip
Fix typedregex2 and typedregex3 tesets for MPFR.
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/mpfr.c b/mpfr.c
index 3b4258cc..3ffcba17 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -247,7 +247,7 @@ mpg_maybe_float(const char *str, int use_locale)
/* mpg_zero --- initialize with arbitrary-precision integer(GMP) and set value to zero */
-static inline void
+void
mpg_zero(NODE *n)
{
if (is_mpg_float(n)) {
@@ -271,7 +271,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
char save;
int tval, base = 10;
- if (n->stlen == 0) {
+ if (n->stlen == 0 || (n->flags & REGEX) != 0) {
mpg_zero(n);
return false;
}
@@ -1525,7 +1525,13 @@ mpg_interpret(INSTRUCTION **cp)
NODE **lhs;
int tval; /* the ternary value returned by a MPFR function */
- switch ((op = pc->opcode)) {
+ op = pc->opcode;
+ if (do_itrace) {
+ fprintf(stderr, "+ mpg_interpret: %s: ", opcode2str(op));
+ fflush(stderr);
+ }
+
+ switch (op) {
case Op_plus_i:
t2 = force_number(pc->memory);
goto plus;
@@ -1750,10 +1756,18 @@ mod:
break;
default:
+ if (do_itrace) {
+ fprintf(stderr, "unhandled\n", opcode2str(op));
+ fflush(stderr);
+ }
return true; /* unhandled */
}
*cp = pc->nexti; /* next instruction to execute */
+ if (do_itrace) {
+ fprintf(stderr, "handled\n", opcode2str(op));
+ fflush(stderr);
+ }
return false;
}