summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-08-23 21:09:46 +0000
committerjilles <jilles@FreeBSD.org>2009-08-23 21:09:46 +0000
commit4a8e08a1103988b9e44d3ae9584cd654796998b1 (patch)
tree907e1a91ca6ca57f1742a6081e71d2fcd1f405a4 /tools/regression
parentf0ee7a159b9f49405e827b40fed36a844334c3ac (diff)
downloadFreeBSD-src-4a8e08a1103988b9e44d3ae9584cd654796998b1.zip
FreeBSD-src-4a8e08a1103988b9e44d3ae9584cd654796998b1.tar.gz
sh: Fix crash when undefining or redefining a currently executing function.
Add a reference count to function definitions. Memory may leak if multiple SIGINTs arrive in interactive mode, this will be fixed later by changing SIGINT handling. PR: bin/137640
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/bin/sh/execution/func1.04
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/execution/func1.0 b/tools/regression/bin/sh/execution/func1.0
new file mode 100644
index 0000000..317b005
--- /dev/null
+++ b/tools/regression/bin/sh/execution/func1.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+MALLOC_OPTIONS=J sh -c 'g() { g() { :; }; :; }; g' &&
+MALLOC_OPTIONS=J sh -c 'g() { unset -f g; :; }; g'
OpenPOWER on IntegriCloud