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

Fix zend_get_constant() usage #1235

Merged
merged 3 commits into from Sep 17, 2013
Merged

Fix zend_get_constant() usage #1235

merged 3 commits into from Sep 17, 2013

Conversation

ghost
Copy link

@ghost ghost commented Sep 16, 2013

zend_get_constant() returns 1 or 0, not SUCCESS or FAILURE

@ghost
Copy link
Author

ghost commented Sep 16, 2013

Safe to merge, build failure will be fixed by #1234

@ghost
Copy link
Author

ghost commented Sep 16, 2013

@dreamsxin please take a look

@dreamsxin
Copy link
Contributor

OK, Why the code can be executed as usual?

@ghost
Copy link
Author

ghost commented Sep 17, 2013

Because zend_get_constant() returns either 0 (failure) or 1 (success).

FAILURE constant is equal to -1.

Because zend_get_constant() can never return -1, the condition is always false and the branch where the constant is assumed to exist is taken.

phalcon pushed a commit that referenced this pull request Sep 17, 2013
@phalcon phalcon merged commit 068667a into phalcon:1.3.0 Sep 17, 2013
@ghost ghost deleted the zend_get_constant branch September 18, 2013 01:34
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