aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/panic.c')
-rw-r--r--src/pkg/runtime/panic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pkg/runtime/panic.c b/src/pkg/runtime/panic.c
index 963063a8e8..8ec8078d22 100644
--- a/src/pkg/runtime/panic.c
+++ b/src/pkg/runtime/panic.c
@@ -104,11 +104,15 @@ popdefer(void)
static void
freedefer(Defer *d)
{
+ int32 total;
+
if(d->special) {
if(d->free)
runtime·free(d);
} else {
- runtime·memclr((byte*)d->args, d->siz);
+ // Wipe out any possible pointers in argp/pc/fn/args.
+ total = sizeof(*d) + ROUND(d->siz, sizeof(uintptr)) - sizeof(d->args);
+ runtime·memclr((byte*)d, total);
}
}