diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:40:50 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:40:50 +0300 |
commit | db0ad810899edd82b68ac681a4b1111fc25b3e30 (patch) | |
tree | 853bae05bcf28150f85b53976c505fda8eb40406 /interpret.h | |
parent | 38126dd894446fdbdddded3f3d4bd807d1764ebc (diff) | |
parent | 34021ae7b7b8662b41fe6feeced4cf619cb31c21 (diff) | |
download | egawk-db0ad810899edd82b68ac681a4b1111fc25b3e30.tar.gz egawk-db0ad810899edd82b68ac681a4b1111fc25b3e30.tar.bz2 egawk-db0ad810899edd82b68ac681a4b1111fc25b3e30.zip |
Merge branch 'master' into feature/fix-comments
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) { |