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

Use ZVAL_COPY_VALUE when passing parameters #1419

Merged
merged 1 commit into from
Mar 24, 2017
Merged

Conversation

sjinks
Copy link
Contributor

@sjinks sjinks commented Mar 24, 2017

No description provided.

@@ -283,8 +283,7 @@ int zephir_call_user_function(zval *object_pp, zend_class_entry *obj_ce, zephir_

zval p[fci.param_count];
for (i=0; i<fci.param_count; ++i) {
/** FIXME: ZVAL_COPY or ZVAL_COPY_VALUE? */
ZVAL_COPY(&p[i], params[i]);
ZVAL_COPY_VALUE(&p[i], params[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

You have a good memory 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just experience :-) I had a similar issue in PHP-CPP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Parameter 3 to preg_match_all() expected to be a reference, value given" - this was the clue

@sergeyklay
Copy link
Contributor

Is it ready to merging?

@sjinks sjinks merged commit 807d62b into zephir-lang:master Mar 24, 2017
@sergeyklay
Copy link
Contributor

Good catch! Thank you 👍

@sjinks sjinks deleted the zcv branch March 24, 2017 22:56
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