1
0
mirror of https://github.com/golang/go synced 2024-10-05 11:41:22 -06:00
go/src/debug
Austin Clements 535741a69a debug/dwarf: fix nil pointer dereference in cyclic type structures
Currently readType simultaneously constructs a type graph and resolves
the sizes of the types. However, these two operations are
fundamentally at odds: the order we parse a cyclic structure in may be
different than the order we need to resolve type sizes in. As a
result, it's possible that when readType attempts to resolve the size
of a typedef, it may dereference a nil Type field of another typedef
retrieved from the type cache that's only partially constructed.

To fix this, we delay resolving typedef sizes until the end of the
readType recursion, when the full type graph is constructed.

Fixes #13039.

Change-Id: I9889af37fb3be5437995030fdd61e45871319d07
Reviewed-on: https://go-review.googlesource.com/18459
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-01-14 02:05:31 +00:00
..
dwarf debug/dwarf: fix nil pointer dereference in cyclic type structures 2016-01-14 02:05:31 +00:00
elf debug/elf: rename Chdr64.Reserved to _ 2015-12-18 20:41:26 +00:00
gosym debug/gosym: clean up and modernize pclntab_test 2015-10-07 17:01:59 +00:00
macho all: remove executable bit from several files 2015-09-04 02:59:49 +00:00
pe debug/pe: truncate pe sections to their size in memory 2015-07-10 03:33:38 +00:00
plan9obj all: remove executable bit from several files 2015-09-04 02:59:49 +00:00