diff options
author | Cody Mello <melloc@writev.io> | 2019-06-17 10:08:54 -0900 |
---|---|---|
committer | Arnold Robbins <arnold@skeeve.com> | 2019-06-17 22:08:54 +0300 |
commit | ae99b752af2f72bae5d4948f5b2e31dac0409601 (patch) | |
tree | 8bd930184186cb84833dfe57706844d06d991469 /run.c | |
parent | fabf9efece19b24f11aa26dd4b63f7af52ab4bcc (diff) | |
download | one-true-awk-ae99b752af2f72bae5d4948f5b2e31dac0409601.tar.gz |
Disallow deleting SYMTAB and its elements (#43)
Diffstat (limited to 'run.c')
-rw-r--r-- | run.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -512,6 +512,9 @@ Cell *awkdelete(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts * int nsub; x = execute(a[0]); /* Cell* for symbol table */ + if (x == symtabloc) { + FATAL("cannot delete SYMTAB or its elements"); + } if (!isarr(x)) return True; if (a[1] == 0) { /* delete the elements, not the table */ |