Skip to content

fix: throw instead of crashing when a method is called with a foreign native receiver - #54316

Merged
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-throw-instead-of-crashing-when-a-method-is-called-with-a-foreign-native-receiver-1790284615349
Sep 24, 2026
Merged

MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-throw-instead-of-crashing-when-a-method-is-called-with-a-foreign-native-receiver-1790284615349

Conversation

@trop

@trop trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Backport of #54313

See that PR for details.

Notes: Fixed a main process crash when a native API method was called with a this value of a different native type; it now throws a TypeError.

… native receiver

DeprecatedWrapperInfo::From assumed that any object with the expected
number of internal fields had a wrapper info in field 0. cppgc-managed
gin::Wrappable objects (session, app, ...) have the same field count but
leave the fields null, so calling e.g. webContents.isLoading with a
session as the receiver dereferenced null in the main process instead of
throwing 'Illegal invocation'.

Co-authored-by: Sam Attard <[email protected]>
@trop
trop Bot requested a review from MarshallOfSound September 24, 2026 21:17
@trop trop Bot added 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 24, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 24, 2026 21:18
@MarshallOfSound
MarshallOfSound merged commit e604fbf into 43-x-y Sep 24, 2026
91 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/43-x-y-bp-fix-throw-instead-of-crashing-when-a-method-is-called-with-a-foreign-native-receiver-1790284615349 branch September 24, 2026 22:21
@release-clerk

release-clerk Bot commented Sep 24, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a main process crash when a native API method was called with a this value of a different native type; it now throws a TypeError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants