diff options
author | Johannes Schlüter <johannes@php.net> | 2014-01-18 13:53:15 +0100 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2014-01-18 13:53:15 +0100 |
commit | 84efb8fc718d63c8522b0c1602caa84c84de8db1 (patch) | |
tree | eb34dd5a59e99d457ea8a9960781b5458f4f8666 /sapi/phpdbg/phpdbg_opcode.c | |
parent | 86096a99ece7e9ccc56446cf06c8963a3c770fb3 (diff) | |
parent | 8ff4d61f0864fbca7b2905f14de76fd400d9b3df (diff) | |
download | php-git-84efb8fc718d63c8522b0c1602caa84c84de8db1.tar.gz |
Merge branch 'PHP-5.6'
Diffstat (limited to 'sapi/phpdbg/phpdbg_opcode.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_opcode.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 7e64d16d92..50073eb22b 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -52,13 +52,15 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint case IS_VAR: case IS_TMP_VAR: { zend_ulong id = 0, *pid = NULL; - if (zend_hash_index_find(vars, (zend_ulong) ops->vars - op->var, (void**) &pid) != SUCCESS) { - id = zend_hash_num_elements(vars); - zend_hash_index_update( - vars, (zend_ulong) ops->vars - op->var, - (void**) &id, - sizeof(zend_ulong), NULL); - } else id = *pid; + if (vars != NULL) { + if (zend_hash_index_find(vars, (zend_ulong) ops->vars - op->var, (void**) &pid) != SUCCESS) { + id = zend_hash_num_elements(vars); + zend_hash_index_update( + vars, (zend_ulong) ops->vars - op->var, + (void**) &id, + sizeof(zend_ulong), NULL); + } else id = *pid; + } asprintf(&decode, "@%lu", id); } break; |