Skip to content

accounts/abi/bind Handle structs used only as constructor params#23940

Merged
holiman merged 1 commit intoethereum:masterfrom
divergencetech:issue-23939
Dec 2, 2021
Merged

accounts/abi/bind Handle structs used only as constructor params#23940
holiman merged 1 commit intoethereum:masterfrom
divergencetech:issue-23939

Conversation

@divergencetech
Copy link
Copy Markdown
Contributor

Fixes issue #23939

The structs map is populated by iterating over all methods except the constructor,
which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.

…arams

Fixes issue ethereum#23939

The `structs` map is populated by iterating over all methods except the constructor,
which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.
}
// Generate the test file with the injected test code
code := fmt.Sprintf(`
t.Run(tt.name, func(t *testing.T) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff here suggests more substantial changes than I've actually performed. I've merely run each test as a sub-test for improved reporting as they're easier to read than test %d.

Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@divergencetech
Copy link
Copy Markdown
Contributor Author

divergencetech commented Nov 23, 2021

Thanks for the quick review.

Is it possible to rerun the checks? The failing test looks spurious and unrelated. I've run make test on my branch without issue.

@holiman
Copy link
Copy Markdown
Contributor

holiman commented Nov 25, 2021

Is it possible to rerun the checks?

Doing that now

@rjl493456442 rjl493456442 added this to the 1.10.14 milestone Nov 29, 2021
@holiman holiman merged commit b45931c into ethereum:master Dec 2, 2021
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
…params (ethereum#23940)

The `structs` map is populated by iterating over all methods except the constructor, which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.

Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
@ian0371 ian0371 mentioned this pull request Dec 31, 2024
9 tasks
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 24, 2025
…params (ethereum#23940)

The `structs` map is populated by iterating over all methods except the constructor, which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.

Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants