diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:40:17 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-04-02 16:40:17 +0300 |
commit | 34021ae7b7b8662b41fe6feeced4cf619cb31c21 (patch) | |
tree | 6eb8b08d2d742d9e479012d542481d3b9a98e3b2 /interpret.h | |
parent | 2f996c14cd0175edf4fedf8335e40c4dd46e67f7 (diff) | |
parent | e3863843f1f37bf854a4f5a8cf2985448933a42f (diff) | |
download | egawk-34021ae7b7b8662b41fe6feeced4cf619cb31c21.tar.gz egawk-34021ae7b7b8662b41fe6feeced4cf619cb31c21.tar.bz2 egawk-34021ae7b7b8662b41fe6feeced4cf619cb31c21.zip |
Merge branch 'gawk-4.2-stable'
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) { |