Skip to content

Fix regression in 0.10.x: fix type for is_detached#1123

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
barracuda156:powerpc
Jul 17, 2025
Merged

Fix regression in 0.10.x: fix type for is_detached#1123
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
barracuda156:powerpc

Conversation

@barracuda156
Copy link
Copy Markdown
Contributor

This fixes regression in 0.10.0, see: #1122
Subsequent segfault still remains, but it also happens with 0.9.0 and 0.8.0.

@andrjohns @bnoordhuis

Comment thread quickjs.c
int __gc_ref_count; /* corresponds to header.ref_count */
uint8_t __gc_mark; /* corresponds to header.mark/gc_obj_type */
bool is_detached;
uint8_t is_detached;
Copy link
Copy Markdown
Contributor

@bnoordhuis bnoordhuis Jul 16, 2025

Choose a reason for hiding this comment

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

Ah... do IUC that sizeof(bool) > sizeof(char) on ppc?

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.

Bool is 4 bytes in ppc ABI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It took me a while to understand how this could've happened because it's from a change we picked from bellard/quickjs...

...but looks like @saghul changed the uint8_t in commit bellard/quickjs@9bd10d8 to a bool, not realizing JSVarRef is aliased as JSGCObjectHeader (and I didn't catch that during review either.)

LGTM but I'll merge this with a commit log explaining the above.

Comment thread quickjs.c
int __gc_ref_count; /* corresponds to header.ref_count */
uint8_t __gc_mark; /* corresponds to header.mark/gc_obj_type */
bool is_detached;
uint8_t is_detached;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It took me a while to understand how this could've happened because it's from a change we picked from bellard/quickjs...

...but looks like @saghul changed the uint8_t in commit bellard/quickjs@9bd10d8 to a bool, not realizing JSVarRef is aliased as JSGCObjectHeader (and I didn't catch that during review either.)

LGTM but I'll merge this with a commit log explaining the above.

@bnoordhuis bnoordhuis merged commit b079cf7 into quickjs-ng:master Jul 17, 2025
127 checks passed
@barracuda156 barracuda156 deleted the powerpc branch July 17, 2025 12:02
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.

2 participants