summaryrefslogtreecommitdiff
path: root/interpret.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-01-08 20:53:54 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-01-08 20:53:54 +0200
commitebe9dd1633c6f5e5d42e922a70f72829c14c193c (patch)
treefeb83b935704aaecb189657213b6e98b8f6ee709 /interpret.h
parent660a55b365e4ee22f3f0efe69c887e2fd1f71303 (diff)
downloadgawk-ebe9dd1633c6f5e5d42e922a70f72829c14c193c.tar.gz
Fix a bug in retrieving unset variables through SYMTAB.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/interpret.h b/interpret.h
index 4a7979bd..d157b5b2 100644
--- a/interpret.h
+++ b/interpret.h
@@ -288,6 +288,11 @@ uninitialized_scalar:
}
if (r->type == Node_var)
r = r->var_value;
+ else if (r->type == Node_var_new) {
+ // variable may exist but have never been set.
+ r->var_value = dupnode(Nnull_string);
+ r = r->var_value;
+ }
}
if (r->type == Node_val)