Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ typedef struct JSVarRef {
struct {
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
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
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
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.

};
};
JSValue *pvalue; /* pointer to the value, either on the stack or
Expand Down
Loading