diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-28 22:23:36 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-28 22:23:36 +0300 |
commit | 49e523a61a7092a890622e5df18d3503c071d889 (patch) | |
tree | 712bb789e6d106345675860a14514128b96f79bc /interpret.h | |
parent | 056cd074c60d940d5bb46410f114a6c2584daaae (diff) | |
parent | 2befea585a321d9d092bfb99cbfa65350a839752 (diff) | |
download | egawk-49e523a61a7092a890622e5df18d3503c071d889.tar.gz egawk-49e523a61a7092a890622e5df18d3503c071d889.tar.bz2 egawk-49e523a61a7092a890622e5df18d3503c071d889.zip |
Merge branch 'master' into feature/cmake
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/interpret.h b/interpret.h index 1005174a..0a5cbbfe 100644 --- a/interpret.h +++ b/interpret.h @@ -948,7 +948,6 @@ arrayfor: break; case Op_ext_builtin: - case Op_old_ext_builtin: { int arg_count = pc->expr_count; awk_value_t result; @@ -991,6 +990,8 @@ arrayfor: r = POP_STRING(); unref(m->re_exp); m->re_exp = r; + } else if (m->type == Node_typedregex) { + UPREF(m); } PUSH(m); break; @@ -1084,8 +1085,7 @@ match_re: PUSH(r); break; } else if (f->type != Node_func) { - if ( f->type == Node_ext_func - || f->type == Node_old_ext_func) { + if (f->type == Node_ext_func) { /* code copied from below, keep in sync */ INSTRUCTION *bc; char *fname = pc->func_name; @@ -1096,10 +1096,7 @@ match_re: bc = f->code_ptr; assert(bc->opcode == Op_symbol); - if (f->type == Node_ext_func) - npc[0].opcode = Op_ext_builtin; /* self modifying code */ - else - npc[0].opcode = Op_old_ext_builtin; /* self modifying code */ + npc[0].opcode = Op_ext_builtin; /* self modifying code */ npc[0].extfunc = bc->extfunc; npc[0].expr_count = arg_count; /* actual argument count */ npc[1] = pc[1]; @@ -1125,12 +1122,12 @@ match_re: f = pc->func_body; if (f == NULL) { f = lookup(pc->func_name); - if (f == NULL || (f->type != Node_func && f->type != Node_ext_func && f->type != Node_old_ext_func)) + if (f == NULL || (f->type != Node_func && f->type != Node_ext_func)) fatal(_("function `%s' not defined"), pc->func_name); pc->func_body = f; /* save for next call */ } - if (f->type == Node_ext_func || f->type == Node_old_ext_func) { + if (f->type == Node_ext_func) { /* keep in sync with indirect call code */ INSTRUCTION *bc; char *fname = pc->func_name; @@ -1138,10 +1135,7 @@ match_re: bc = f->code_ptr; assert(bc->opcode == Op_symbol); - if (f->type == Node_ext_func) - pc->opcode = Op_ext_builtin; /* self modifying code */ - else - pc->opcode = Op_old_ext_builtin; /* self modifying code */ + pc->opcode = Op_ext_builtin; /* self modifying code */ pc->extfunc = bc->extfunc; pc->expr_count = arg_count; /* actual argument count */ (pc + 1)->func_name = fname; /* name of the builtin */ |