Skip to content
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

Try tests with Cstring #301

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

joehoyle
Copy link
Collaborator

@joehoyle joehoyle commented Dec 1, 2023

No description provided.

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

Super strange that this is passing, it's very clear that the type should be a zend_string, not a C string...
https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6327

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

I think they are converted to ZendStr when copied from ZendFunctionEntry maybe? Looking at the macros for registering functions return types for internal functions, I can't see anything that expects a ZendStr there (ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO -> ZEND_TYPE_INIT_CLASS)

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

Ahh there's another _ZEND_TYPE_LITERAL_NAME_BIT flag, used to signify that type.ptr is not a zend_string* but a const char*

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

Ahhh! Nice find :D

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

But we're using _ZEND_TYPE_NAME_BIT, not _ZEND_TYPE_LITERAL_NAME_BIT...

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

I think this might be different across PHP versions.. or something. IN PHP 8.3, there is:

/* Only one of these bits may be set. */
#define _ZEND_TYPE_NAME_BIT (1u << 24)
// Used to signify that type.ptr is not a `zend_string*` but a `const char*`,
#define _ZEND_TYPE_LITERAL_NAME_BIT (1u << 23)

whereas PHP 8.0:

#define _ZEND_TYPE_NAME_BIT (1u << 23)

@danog danog merged commit 3dcce49 into revert-293-revert-121-feat-integration-tests Dec 7, 2023
24 of 26 checks passed
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