diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:37:17 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:37:17 +0300 |
commit | 0742fa4072e894ba08babcc5c699bc0f48841ed3 (patch) | |
tree | 355071e65d6af3ebf23db457ef6345b38e9751c9 /interpret.h | |
parent | f933fc9f8a05cf51fe94fc1ed24dc2a1586af42c (diff) | |
download | egawk-0742fa4072e894ba08babcc5c699bc0f48841ed3.tar.gz egawk-0742fa4072e894ba08babcc5c699bc0f48841ed3.tar.bz2 egawk-0742fa4072e894ba08babcc5c699bc0f48841ed3.zip |
Copy MPZ/MPFR bits also, in r_dupnode.
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/interpret.h b/interpret.h index 96e2c890..20fcb7ad 100644 --- a/interpret.h +++ b/interpret.h @@ -32,16 +32,25 @@ * valref 1, that effectively means that this is an assignment like "$n = $n", * so a no-op, other than triggering $0 reconstitution. */ -#define UNFIELD(l, r) \ -{ \ - /* if was a field, turn it into a var */ \ - if ((r->flags & MALLOC) != 0 || r->valref == 1) { \ - l = r; \ - } else { \ - l = dupnode(r); \ - DEREF(r); \ - } \ + +// not a macro so we can step into it with a debugger +#ifndef UNFIELD_DEFINED +#define UNFIELD_DEFINED 1 +static inline void +unfield(NODE **l, NODE **r) +{ + /* if was a field, turn it into a var */ + if (((*r)->flags & MALLOC) != 0 || (*r)->valref == 1) { + (*l) = (*r); + } else { + (*l) = dupnode(*r); + DEREF(*r); + } } + +#define UNFIELD(l, r) unfield(& (l), & (r)) +#endif + int r_interpret(INSTRUCTION *code) { |