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 error zephir_memory_observe #1871

Merged
merged 1 commit into from
Jun 19, 2019
Merged

Conversation

dreamsxin
Copy link
Contributor

@dreamsxin dreamsxin commented Jun 19, 2019

Hello!

  • Type: bug fix
  • Link to issue:

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I updated the CHANGELOG

Small description of change:

Thanks

@dreamsxin
Copy link
Contributor Author

@sergeyklay

Legend: ?-unknown, I-invalid file syntax, file ignored, S-Skipped, .-no changes, F-fixed, E-error
   1) prototypes/redis.php (phpdoc_no_alias_tag)
      ---------- begin diff ----------
--- Original
+++ New
@@ @@
     /**
-     * @link https://github.com/phpredis/phpredis#setoption
+     * @see https://github.com/phpredis/phpredis#setoption
@@ @@
     /**
-     * @link https://github.com/phpredis/phpredis#getoption
+     * @see https://github.com/phpredis/phpredis#getoption
      *
      * @param mixed $name
      *
      * @return mixed
      */
     public function getOption($name)
     {
     }
 }
 
      ----------- end diff -----------

@sergeyklay sergeyklay merged commit b2a3e7f into zephir-lang:development Jun 19, 2019
@sergeyklay
Copy link
Member

Thank you!

@sergeyklay
Copy link
Member

sergeyklay commented Jun 19, 2019

@dreamsxin Could you please take a look here: https://travis-ci.org/phalcon/cphalcon/jobs/547678133

Thread 1 (Thread 0x7fc65c944d00 (LWP 11204)):
0  0x00007fc6576e1c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007fc6576e5028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007fc63fcbefc4 in zephir_do_memory_observe (var=0x7ffe52196b70, g=0x3406f90) at /home/travis/build/phalcon/cphalcon/ext/kernel/memory.c:556
3  0x00007fc63fcbf113 in zephir_memory_alloc (var=0x7ffe52196b70) at /home/travis/build/phalcon/cphalcon/ext/kernel/memory.c:581
4  0x00007fc6402e882b in zim_Phalcon_Html_Tag_appendTitle (execute_data=0x7fc651826070, return_value=0x7ffe52196bf0) at /home/travis/build/phalcon/cphalcon/ext/phalcon/html/tag.zep.c:172
5  0x00000000009b9aa8 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /tmp/php-build/source/7.3.2/Zend/zend_vm_execute.h:980
6  execute_ex (ex=0x2bc4) at /tmp/php-build/source/7.3.2/Zend/zend_vm_execute.h:55485
7  0x000000000091d55f in zend_call_function (fci=0x7fc62b3f2010, fci@entry=0x7ffe52196d60, fci_cache=fci_cache@entry=0x7ffe52196d40) at /tmp/php-build/source/7.3.2/Zend/zend_execute_API.c:756
8  0x0000000000771c67 in reflection_method_invoke (execute_data=<optimized out>, return_value=0x7ffe52196e10, variadic=0) at /tmp/php-build/source/7.3.2/ext/reflection/php_reflection.c:3186
9  0x00000000009b9aa8 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /tmp/php-build/source/7.3.2/Zend/zend_vm_execute.h:980
10 execute_ex (ex=0x2bc4) at /tmp/php-build/source/7.3.2/Zend/zend_vm_execute.h:55485
11 0x00000000009bad26 in zend_execute (op_array=<optimized out>, return_value=<optimized out>) at /tmp/php-build/source/7.3.2/Zend/zend_vm_execute.h:60881
12 0x000000000092c857 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /tmp/php-build/source/7.3.2/Zend/zend.c:1568
13 0x00000000008c0236 in php_execute_script (primary_file=primary_file@entry=0x7ffe521982a0) at /tmp/php-build/source/7.3.2/main/main.c:2630
14 0x00000000009bd3ba in do_cli (argc=6, argv=0x32c5bf0) at /tmp/php-build/source/7.3.2/sapi/cli/php_cli.c:997
15 0x0000000000469b50 in main (argc=6, argv=0x32c5bf0) at /tmp/php-build/source/7.3.2/sapi/cli/php_cli.c:1389

Generated code is:

PHP_METHOD(Phalcon_Html_Tag, appendTitle) {

	zval _0$$4;
	zval *title, title_sub;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&title_sub);
	ZVAL_UNDEF(&_0$$4);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &title);



	if (Z_TYPE_P(title) == IS_ARRAY) {
		zephir_update_property_zval(this_ptr, SL("append"), title);
	} else {
		zephir_get_strval(&_0$$4, title);
		zephir_update_property_array_append(this_ptr, SL("append"), &_0$$4);
		ZEPHIR_INIT_VAR(&_0$$4);
	}
	RETURN_THIS();

}

172 line is ZEPHIR_INIT_VAR(&_0$$4);

Zephir code:

    public function appendTitle(var title) -> <Tag>
    {
        if typeof title === "array" {
            let this->append = title;
        } else {
            let this->append[] = (string) title;
        }

        return this;
    }

@dreamsxin dreamsxin mentioned this pull request Jun 20, 2019
3 tasks
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.

None yet

2 participants