aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/devirtualize/devirtualize.go
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2025-10-11 11:37:58 -0700
committerJoseph Tsai <joetsai@digital-static.net>2025-10-13 17:01:45 -0700
commit6fd8e88d07b08531a5585aa4fbcc6043d556742f (patch)
tree228722ad58335f82fc1ae1fb548ceba7fea3d3d5 /src/cmd/compile/internal/devirtualize/devirtualize.go
parent1abc6b0204ed231311c9bbc53cfab36dc546aa8e (diff)
downloadgo-6fd8e88d07b08531a5585aa4fbcc6043d556742f.tar.xz
encoding/json/v2: restrict presence of default options
Originally, DefaultOptionsV1 and DefaultOptionsV2 represented the full set of all options with specific ones set to true or false. However, there are certain options such as WithIndent or WithMarshalers that are neither v1 or v2 specific. At some point we removed whitespace related options from the set: https://github.com/go-json-experiment/json/pull/26 This avoids DefaultOptionsV1 or DefaultOptionsV2 from affecting any previously set whitespace. However, why are whitespace options special and thus excluded from the set? What about Marshalers? As a more principaled way to address this, we restrict DefaultOptionsV1 and DefaultOptionsV2 to only be the options where the default setting changes between v1 and v2. All other options are unpopulated. This avoids a panic with GetOption(DefaultOptionsV2, WithMarshalers) since DefaultOptionsV2 previously had the presence bit for Marshalers set to true, but had no actual value. Now, the presence bit is set to false, so the value is not consulted. Fixes #75149 Change-Id: I30b45abd35404578b4135cc3bad1a1a2993cb0cf Reviewed-on: https://go-review.googlesource.com/c/go/+/710878 Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/cmd/compile/internal/devirtualize/devirtualize.go')
0 files changed, 0 insertions, 0 deletions