aboutsummaryrefslogtreecommitdiff
path: root/run.c
diff options
context:
space:
mode:
authorCody Mello <melloc@writev.io>2019-06-17 10:08:54 -0900
committerArnold Robbins <arnold@skeeve.com>2019-06-17 22:08:54 +0300
commitae99b752af2f72bae5d4948f5b2e31dac0409601 (patch)
tree8bd930184186cb84833dfe57706844d06d991469 /run.c
parentfabf9efece19b24f11aa26dd4b63f7af52ab4bcc (diff)
downloadone-true-awk-ae99b752af2f72bae5d4948f5b2e31dac0409601.tar.gz
Disallow deleting SYMTAB and its elements (#43)
Diffstat (limited to 'run.c')
-rw-r--r--run.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/run.c b/run.c
index 2dfb3e6..36e5e85 100644
--- a/run.c
+++ b/run.c
@@ -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 */