diff options
| author | Daniel Martà <mvdan@mvdan.cc> | 2023-04-07 18:53:49 +0100 |
|---|---|---|
| committer | Daniel Martà <mvdan@mvdan.cc> | 2023-10-26 07:37:45 +0000 |
| commit | 5fe2035927bc9fac8a375a96d9ef47735c10fba4 (patch) | |
| tree | 0c225551372e7899fb6e6924d4fc34c89290d471 /src/runtime/testdata/testprogcgo/stackswitch.c | |
| parent | 555af99bcc6b7515ebad5a3c947f3e4ab147fd29 (diff) | |
| download | go-5fe2035927bc9fac8a375a96d9ef47735c10fba4.tar.xz | |
internal/profile: actually return errors in postDecode
As spotted by staticcheck, the body did keep track of errors by sharing
a single err variable, but its last value was never used as the function
simply finished by returning nil.
To prevent postDecode from erroring on empty profiles,
which breaks TestEmptyProfile, add a check at the top of the function.
Update the runtime/pprof test accordingly,
since the default units didn't make sense for an empty profile anyway.
Change-Id: I188cd8337434adf9169651ab5c914731b8b20f39
Reviewed-on: https://go-review.googlesource.com/c/go/+/483137
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/testdata/testprogcgo/stackswitch.c')
0 files changed, 0 insertions, 0 deletions
