Skip to content

Add tests for DatePeriod properties #4198

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

Closed

Conversation

duncan3dc
Copy link
Member

While merging #3121 up I noticed that there appears to be a segfault introduced in the PHP-7.4 branch.

These tests pass on PHP-7.2, PHP-7.3, but they cause a segfault on PHP-7.4

@duncan3dc duncan3dc force-pushed the date-period-properties-segfault branch from 737cc05 to b982f13 Compare May 28, 2019 20:19
@duncan3dc
Copy link
Member Author

git bisect suggests that 1cfbb21 is the offending commit

@cmb69
Copy link
Member

cmb69 commented May 28, 2019

Aha! Looks like

date_object_handlers_period.get_property_ptr_ptr = NULL;
is the culprit, since the get_property_ptr_ptr handler is now required.

@duncan3dc
Copy link
Member Author

@cmb69 Thanks for the pointer!
I've added the required handler in fc8e1433c9e8a0eebb1b369013ad788493c8053 but I'm not sure if that's the appropriate way to handle it

@nikic
Copy link
Member

nikic commented May 29, 2019

I've applied the tests via 5d67271 to 7.2+ and added the missing handler in 3bd5b83. Thanks for catching this!

@nikic nikic closed this May 29, 2019
@nikic
Copy link
Member

nikic commented May 29, 2019

I've added the required handler in fc8e1433c9e8a0eebb1b369013ad788493c8053 but I'm not sure if that's the appropriate way to handle it

Whoops, looks like we worked on this at the same time. In this case there's no need to replicate the logic inside get_property_ptr_ptr, we just have to tell the engine that it should use read_property instead. Once properties on DatePeriod are permitted (#3121), it would be possible to use this handler for all the non-magic ones for improved performance.

@duncan3dc duncan3dc deleted the date-period-properties-segfault branch May 29, 2019 08:10
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.

3 participants