aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-28 21:53:31 -0400
committerRuss Cox <rsc@golang.org>2014-10-28 21:53:31 -0400
commit8fcdc70c5ebf9c8d160b85e9402e7db5f4bf0793 (patch)
tree8cadab21060a7e9cc7b79b10aea00ced0ec2c34e /src/runtime/runtime.c
parentc4efaac15daac5e15092532dcc7ca9c30a0e0fbc (diff)
downloadgo-8fcdc70c5ebf9c8d160b85e9402e7db5f4bf0793.tar.xz
runtime: add GODEBUG invalidptr setting
Fixes #8861. Fixes #8911. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/165780043
Diffstat (limited to 'src/runtime/runtime.c')
-rw-r--r--src/runtime/runtime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index b3503fb909..c823691ec5 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -276,9 +276,13 @@ struct DbgVar
int32* value;
};
+// Do we report invalid pointers found during stack or heap scans?
+int32 runtime·invalidptr = 1;
+
#pragma dataflag NOPTR /* dbgvar has no heap pointers */
static DbgVar dbgvar[] = {
{"allocfreetrace", &runtime·debug.allocfreetrace},
+ {"invalidptr", &runtime·invalidptr},
{"efence", &runtime·debug.efence},
{"gctrace", &runtime·debug.gctrace},
{"gcdead", &runtime·debug.gcdead},