summaryrefslogtreecommitdiffstats
path: root/bin/sh/memalloc.h
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-11 20:51:00 +0000
committerjilles <jilles@FreeBSD.org>2013-05-11 20:51:00 +0000
commite0dffd814f1f48f0b8357b4219a29a93556985bd (patch)
treebe11628c178535fe7fd9957134f7f49cfd4252a5 /bin/sh/memalloc.h
parent960e7e9fd4f902c33ef15129c7fe48d67014ca2c (diff)
downloadFreeBSD-src-e0dffd814f1f48f0b8357b4219a29a93556985bd.zip
FreeBSD-src-e0dffd814f1f48f0b8357b4219a29a93556985bd.tar.gz
sh: Remove linked list of stack marks.
The linked list of stack marks may cause problems if the allocation stack is used between an exception and a higher-level popstackmark(), as it may then touch a stack mark that is local to a function which has returned. Also, the adjustment compares to a pointer passed to realloc(), which is undefined behaviour. Instead of adjusting stack marks when reallocating stack blocks, ensure that such an adjustment is never necessary by fixing a small piece of memory in place at a stack mark. This also simplifies the code. To avoid the problems reported in bin/175922, it remains necessary to call setstackmark() after popstackmark() if the stack mark remains in use.
Diffstat (limited to 'bin/sh/memalloc.h')
-rw-r--r--bin/sh/memalloc.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/bin/sh/memalloc.h b/bin/sh/memalloc.h
index 95a6594..a22fa39 100644
--- a/bin/sh/memalloc.h
+++ b/bin/sh/memalloc.h
@@ -39,7 +39,6 @@ struct stackmark {
struct stack_block *stackp;
char *stacknxt;
int stacknleft;
- struct stackmark *marknext;
};
OpenPOWER on IntegriCloud